Distinguish between 'Show Groups' checkboxes in Serial Control
authorDan Wells <dbw2@calvin.edu>
Thu, 26 May 2011 15:19:40 +0000 (11:19 -0400)
committerDan Wells <dbw2@calvin.edu>
Thu, 26 May 2011 15:19:40 +0000 (11:19 -0400)
Two different checkboxes ended up with the same ID, which, as one might
expect, kinda worked and kinda didn't.

Signed-off-by: Dan Wells <dbw2@calvin.edu>

Open-ILS/xul/staff_client/server/serial/manage_dists.js
Open-ILS/xul/staff_client/server/serial/manage_dists.xul
Open-ILS/xul/staff_client/server/serial/manage_subs.js
Open-ILS/xul/staff_client/server/serial/manage_subs.xul

index 9e02c1f..1a5cace 100644 (file)
@@ -521,7 +521,7 @@ serial.manage_dists.prototype = {
                     function(ev) {
                         if (document.getElementById('refresh_button')) document.getElementById('refresh_button').focus(); 
                         JSAN.use('util.file'); var file = new util.file('manage_dists_prefs.'+obj.data.server_unadorned);
-                        util.widgets.save_attributes(file, { 'sdist_lib_menu' : [ 'value' ], 'show_sdists' : [ 'checked' ], 'show_groups' : [ 'checked' ] });
+                        util.widgets.save_attributes(file, { 'sdist_lib_menu' : [ 'value' ], 'show_sdists' : [ 'checked' ], 'show_sdist_groups' : [ 'checked' ] });
                         obj.refresh_list();
                     },
                     false
@@ -544,16 +544,16 @@ serial.manage_dists.prototype = {
                 'command',
                 function(ev) {
                     JSAN.use('util.file'); var file = new util.file('manage_dists_prefs.'+obj.data.server_unadorned);
-                    util.widgets.save_attributes(file, { 'sdist_lib_menu' : [ 'value' ], 'show_sdists' : [ 'checked' ], 'show_groups' : [ 'checked' ] });
+                    util.widgets.save_attributes(file, { 'sdist_lib_menu' : [ 'value' ], 'show_sdists' : [ 'checked' ], 'show_sdist_groups' : [ 'checked' ] });
                 },
                 false
             );
 
-            document.getElementById('show_groups').addEventListener(
+            document.getElementById('show_sdist_groups').addEventListener(
                 'command',
                 function(ev) {
                     JSAN.use('util.file'); var file = new util.file('manage_dists_prefs.'+obj.data.server_unadorned);
-                    util.widgets.save_attributes(file, { 'sdist_lib_menu' : [ 'value' ], 'show_sdists' : [ 'checked' ], 'show_groups' : [ 'checked' ] });
+                    util.widgets.save_attributes(file, { 'sdist_lib_menu' : [ 'value' ], 'show_sdists' : [ 'checked' ], 'show_sdist_groups' : [ 'checked' ] });
                 },
                 false
             );
@@ -1001,7 +1001,7 @@ serial.manage_dists.prototype = {
                 }
             }
             node.setAttribute('container','true');
-            if (document.getElementById('show_groups').checked) {
+            if (document.getElementById('show_sdist_groups').checked) {
                 node.setAttribute('open','true');
                 obj.funcs.push( function() { obj.on_select_sdist( sdist_tree.id(), true ); } );
             }
index e72b44d..3daf758 100644 (file)
@@ -73,7 +73,7 @@ vim:noet:sw=4:ts=4:
                         <hbox id="serial_dist_lib_menu"/>
                         <hbox>
                             <checkbox id="show_sdists" label="Show Dists." />
-                            <checkbox id="show_groups" label="Show Groups" />
+                            <checkbox id="show_sdist_groups" label="Show Groups" />
                             <button id="serial_dist_add_button" label="&staff.cat.copy_browser.holdings_maintenance.refresh_button.label;" command="cmd_refresh_list" />
                             <spacer flex="1"/>
                             <menubar>
index 628ebbe..93fd587 100644 (file)
@@ -896,7 +896,7 @@ serial.manage_subs.prototype = {
                     function(ev) {
                         if (document.getElementById('refresh_button')) document.getElementById('refresh_button').focus(); 
                         JSAN.use('util.file'); var file = new util.file('manage_subs_prefs.'+obj.data.server_unadorned);
-                        util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ], 'show_ssubs' : [ 'checked' ], 'show_groups' : [ 'checked' ] });
+                        util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ], 'show_ssubs' : [ 'checked' ], 'show_ssub_groups' : [ 'checked' ] });
                         obj.refresh_list();
                     },
                     false
@@ -917,16 +917,16 @@ serial.manage_subs.prototype = {
                 'command',
                 function(ev) {
                     JSAN.use('util.file'); var file = new util.file('manage_subs_prefs.'+obj.data.server_unadorned);
-                    util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ], 'show_ssubs' : [ 'checked' ], 'show_groups' : [ 'checked' ] });
+                    util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ], 'show_ssubs' : [ 'checked' ], 'show_ssub_groups' : [ 'checked' ] });
                 },
                 false
             );
 
-            document.getElementById('show_groups').addEventListener(
+            document.getElementById('show_ssub_groups').addEventListener(
                 'command',
                 function(ev) {
                     JSAN.use('util.file'); var file = new util.file('manage_subs_prefs.'+obj.data.server_unadorned);
-                    util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ], 'show_ssubs' : [ 'checked' ], 'show_groups' : [ 'checked' ] });
+                    util.widgets.save_attributes(file, { 'lib_menu' : [ 'value' ], 'show_ssubs' : [ 'checked' ], 'show_ssub_groups' : [ 'checked' ] });
                 },
                 false
             );
@@ -1429,7 +1429,7 @@ serial.manage_subs.prototype = {
                 //did this support a later typo? obj.map_sdist[ 'ssub_' + ssub_tree.id() ] = ssub_tree;
                 node.setAttribute('container','true');
             }
-            if (document.getElementById('show_groups').checked) {
+            if (document.getElementById('show_ssub_groups').checked) {
                 node.setAttribute('open','true');
                 obj.funcs.push( function() { obj.on_select_ssub( ssub_tree.id(), true ); } );
             }
index b544763..5dff57b 100644 (file)
@@ -69,7 +69,7 @@ vim:noet:sw=4:ts=4:
                         <hbox id="serial_sub_lib_menu"/>
                         <hbox>
                             <checkbox id="show_ssubs" label="Show Subs." />
-                            <checkbox id="show_groups" label="Show Groups" />
+                            <checkbox id="show_ssub_groups" label="Show Groups" />
                             <button id="serial_sub_add_button" label="&staff.cat.copy_browser.holdings_maintenance.refresh_button.label;" command="cmd_refresh_list" />
                             <spacer flex="1"/>
                             <menubar>