[open-ils-commits] r16007 - branches/rel_1_6_0/Open-ILS/xul/staff_client/chrome/content/OpenILS (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Mar 26 12:02:27 EDT 2010
Author: phasefx
Date: 2010-03-26 12:02:24 -0400 (Fri, 26 Mar 2010)
New Revision: 16007
Modified:
branches/rel_1_6_0/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
Log:
textbox support for oils_persist (to fix stickiness in the label interface). trunk already has this but is so drastically different that I'm afraid to backport
Modified: branches/rel_1_6_0/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js
===================================================================
--- branches/rel_1_6_0/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js 2010-03-26 15:54:28 UTC (rev 16006)
+++ branches/rel_1_6_0/Open-ILS/xul/staff_client/chrome/content/OpenILS/global_util.js 2010-03-26 16:02:24 UTC (rev 16007)
@@ -48,7 +48,13 @@
var key = base_key + attribute_list[j];
var value = prefs.prefHasUserValue(key) ? prefs.getCharPref(key) : null;
dump('persist_helper: retrieving key = ' + key + ' value = ' + value + ' for ' + nodes[i].nodeName + '\n');
- if (value) nodes[i].setAttribute( attribute_list[j], value );
+ if (value) {
+ if (nodes[i].nodeName == 'textbox') {
+ nodes[i].value = value;
+ } else {
+ nodes[i].setAttribute( attribute_list[j], value );
+ }
+ }
}
if (nodes[i].nodeName == 'checkbox' && attribute_list.indexOf('checked') > -1) {
if (nodes[i].disabled == false && nodes[i].hidden == false) {
@@ -80,6 +86,26 @@
false
);
}
+ if (nodes[i].nodeName == 'textbox' && attribute_list.indexOf('value') > -1) {
+ nodes[i].addEventListener(
+ 'change',
+ function(bk) {
+ return function(ev) {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ var key = bk + 'value';
+ var value = ev.target.value;
+ ev.target.setAttribute( 'value', value );
+ prefs.setCharPref( key, value );
+ dump('persist_helper: setting key = ' + key + ' value = ' + value + ' for textbox\n');
+ } catch(E) {
+ alert('Error in persist_helper(), textbox change event listener: ' + E);
+ }
+ };
+ }(base_key),
+ false
+ );
+ }
// TODO: Need to add event listeners for window resizing, splitter repositioning, grippy state, etc.
}
} catch(E) {
More information about the open-ils-commits
mailing list