Fixed perm_list.js/html so the widgets won't overlap when the dojo version is
authorJoseph Lewis <joehms22@gmail.com>
Mon, 11 Jun 2012 21:03:14 +0000 (15:03 -0600)
committerThomas Berezansky <tsbere@mvlc.org>
Wed, 10 Oct 2012 14:22:37 +0000 (10:22 -0400)
upgraded. Also added buttons at the bottom of the screen to the top for
deletion/save. This makes things a tad more useable.

Signed-off-by: Joseph Lewis <joehms22@gmail.com>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/web/conify/global/permission/perm_list.html
Open-ILS/web/conify/global/permission/perm_list.js

index 22c50e3..fe6f5d8 100644 (file)
        <body class="tundra" id='pagebody'>
 
                <div dojoType="dijit.layout.LayoutContainer" id="grid_container" jsId="grid_container" orientation="vertical">
-                       <div dojoType="dijit.layout.LayoutContainer" orientation="horizontal" style="margin-top: 5px;" layoutAlign="top">
+                       <div dojoType="dijit.Toolbar" orientation="horizontal" style="margin-top: 5px;" layoutAlign="top">
                                <span>&conify.perm_list.new_permission.label;</span>
                                <div dojoType="dijit.form.TextBox" id="new_perm_code" jsId="new_perm_code" label="&conify.perm_list.new_code.label;"></div>
                                <button dojoType="dijit.form.Button" id="save_new_perm_code" jsId="save_new_perm_code" label="&conify.perm_list.add_button.label;" onClick="saveNewPermCode()"></button>
+                               
+                               <span dojoType="dijit.ToolbarSeparator"></span>
+                               
+                               
+                               <button jsId="save_ppl_button" dojoType="dijit.form.Button" label="&conify.perm_list.save_changes.label;" onClick="save_them_all()"></button>
+                                       <button jsId="delete_ppl_button" dojoType="dijit.form.Button" label="&conify.perm_list.delete_selected.label;" onClick="delete_them()"></button>
                        </div>
 
                        <div dojoType="dijit.layout.ContentPane" style="width:100%; height:100%;" layoutAlign="client">
                                <div id="perm_grid" dojoType="dojox.grid.DataGrid" store="perm_store" structure="perm_grid_layout" jsId="perm_grid"></div>
-
-                               <div dojoType="dijit.layout.ContentPane" orientation="horizontal" style="margin-bottom: 5px;" layoutAlign="bottom">
-                                       <button jsId="save_ppl_button" dojoType="dijit.form.Button" label="&conify.perm_list.save_changes.label;" onClick="save_them_all()"></button>
-                                       <button jsId="delete_ppl_button" dojoType="dijit.form.Button" label="&conify.perm_list.delete_selected.label;" onClick="delete_them()"></button>
-                               </div>
                        </div>
                </div>
        </body>
 </html>
+
+
index 280e353..1f12048 100644 (file)
@@ -29,6 +29,8 @@ dojo.require('dijit.form.Textarea');
 dojo.require('dijit.layout.ContentPane');
 dojo.require('dijit.layout.LayoutContainer');
 dojo.require('dijit.layout.BorderContainer');
+dojo.require('dijit.Toolbar');
+dojo.require('dijit.ToolbarSeparator');
 dojo.require('dojox.widget.Toaster');
 dojo.require('dojox.fx');
 dojo.require('openils.XUL');
@@ -53,6 +55,13 @@ var virgin_out_id = -1;
 
 var highlighter = {};
 
+
+dojo.addOnLoad(function()
+{
+       highlighter.green = dojox.fx.highlight( { color : '#B4FFB4', node : 'perm_grid', duration : 500 } );
+       highlighter.red = dojox.fx.highlight( { color : '#FF2018', node : 'perm_grid', duration : 500 } );
+});
+
 function status_update (markup) {
        if (parent !== window && parent.status_update) parent.status_update( markup );
 }
@@ -138,7 +147,7 @@ var perm_grid_layout = [
                                  get : function (row) {
                                        var r = perm_grid.getItem(row);
                                        if (r) {
-                                               perm_rows[row] = new ccs().fromHash(perm_grid.getItem(row));
+                                               perm_rows[row] = new ccs().fromHash(r);
                                                setTimeout(
                                                        'dojo.query(".perm_grid_trans_desc_' + row + '").'+
                                                                'instantiate(openils.widget.TranslatorPopup,{field:"description",'+
@@ -202,7 +211,7 @@ var new_code = new_perm_code.getValue();
                        var new_item_hash = list[0].toHash();
                        perm_store.newItem( new_item_hash );
                        status_update( dojo.string.substitute(ppl_strings.SUCCESS_CREATING_PERMISSION, [new_item_hash.code]) );
-                       perm_grid.model.sort(-1);
+                       perm_grid.sort(-1);
                        highlighter.green.play();
                }
        });
@@ -212,17 +221,11 @@ function delete_them()
 {
        var selected_rows = perm_grid.selection.getSelected();
        var selected_items = [];
-       
-       for (var i in selected_rows) {
-               selected_items.push(
-                       perm_grid.model.getRow( selected_rows[i] ).__dojo_data_item
-               );
-       }
 
        perm_grid.selection.clear();
 
-       for (var i in selected_items) {
-               current_perm = selected_items[i];
+       for (var i in selected_rows) {
+               current_perm = selected_rows[i];
 
                if ( confirm( dojo.string.substitute(ppl_strings.CONFIRM_DELETE, [perm_store.getValue(current_perm, 'code')]) ) ) {