From 2150314486ef9a294665b30152c002224c59224c Mon Sep 17 00:00:00 2001 From: phasefx Date: Wed, 30 Sep 2009 16:18:03 +0000 Subject: [PATCH] Indicators for the Checkin Modifiers (since the checkboxes are now hidden from view). oils_persist support for menuitems @type=checkbox. Without that hidePopup() in the onload, oils_persist will make the menu popup sit open. git-svn-id: svn://svn.open-ils.org/ILS/trunk@14224 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../chrome/content/OpenILS/global_util.js | 13 ++++++++---- Open-ILS/xul/staff_client/server/circ/checkin.xul | 2 +- .../staff_client/server/circ/checkin_overlay.xul | 24 +++++++++++++++------- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js b/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js index c524f632d..734f424aa 100644 --- a/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js +++ b/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js @@ -51,7 +51,7 @@ dump('persist_helper: retrieving key = ' + key + ' value = ' + value + ' for ' + nodes[i].nodeName + '\n'); if (value) nodes[i].setAttribute( attribute_list[j], value ); } - if (nodes[i].nodeName == 'checkbox' && attribute_list.indexOf('checked') > -1) { + if ( (nodes[i].nodeName == 'checkbox' || nodes[i].nodeName == 'menuitem') && attribute_list.indexOf('checked') > -1) { if (nodes[i].disabled == false && nodes[i].hidden == false) { var no_poke = nodes[i].getAttribute('oils_persist_no_poke'); if (no_poke && no_poke == 'true') { @@ -69,12 +69,17 @@ try { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var key = bk + 'checked'; - var value = ev.target.checked; + var value; + if (ev.target.nodeName == 'checkbox') { + value = ev.target.checked; + } else { + value = ev.target.getAttribute('checked'); // menuitem with type="checkbox" + } ev.target.setAttribute( 'checked', value ); prefs.setCharPref( key, value ); - dump('persist_helper: setting key = ' + key + ' value = ' + value + ' for checkbox\n'); + dump('persist_helper: setting key = ' + key + ' value = ' + value + ' for checkbox/menuitem\n'); } catch(E) { - alert('Error in persist_helper(), checkbox command event listener: ' + E); + alert('Error in persist_helper(), checkbox/menuitem command event listener: ' + E); } }; }(base_key), diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.xul b/Open-ILS/xul/staff_client/server/circ/checkin.xul index 1ad16631b..892670d3f 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.xul +++ b/Open-ILS/xul/staff_client/server/circ/checkin.xul @@ -20,7 +20,7 @@ diff --git a/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul b/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul index 8c78a4ff0..7c02fb313 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul +++ b/Open-ILS/xul/staff_client/server/circ/checkin_overlay.xul @@ -41,8 +41,14 @@ - @@ -128,15 +134,19 @@ -- 2.11.0