]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/xul/staff_client/chrome/content/evergreen/util/widgets.js
skipping this. Other things to try.. re-ordering the children in the deck.. or just...
[Evergreen.git] / Open-ILS / xul / staff_client / chrome / content / evergreen / util / widgets.js
1 dump('entering util/widgets.js\n');
2
3 if (typeof util == 'undefined') var util = {};
4 util.widgets = {};
5
6 util.widgets.EXPORT_OK  = [ 
7         'disable_accesskeys_in_node_and_children', 
8         'enable_accesskeys_in_node_and_children', 
9 ];
10 util.widgets.EXPORT_TAGS        = { ':all' : util.widgets.EXPORT_OK };
11
12 util.widgets.disable_accesskeys_in_node_and_children = function( node ) {
13         if (node.getAttribute('accesskey')) {
14                 node.setAttribute('oldaccesskey', node.getAttribute('accesskey'));
15                 node.setAttribute('accesskey',''); node.accessKey = '';
16         }
17         for (var i = 0; i < node.childNodes.length; i++) {
18                 util.widgets.disable_accesskeys_in_node_and_children( node.childNodes[i] );
19         }
20         dump('- node = <' + node.id + '> accesskey = <' + node.accessKey + '> accesskey = <' + node.getAttribute('accesskey') + '> oldaccesskey = <' + node.getAttribute('oldaccesskey') + '>\n');
21 }
22
23 util.widgets.enable_accesskeys_in_node_and_children = function( node ) {
24         if (node.getAttribute('oldaccesskey')) {
25                 node.setAttribute('accesskey', node.getAttribute('oldaccesskey'));
26                 node.accessKey = node.getAttribute('oldaccesskey'); 
27                 node.setAttribute('oldaccesskey','');
28         }
29         for (var i = 0; i < node.childNodes.length; i++) {
30                 util.widgets.enable_accesskeys_in_node_and_children( node.childNodes[i] );
31         }
32         dump('+ node = <' + node.id + '> accesskey = <' + node.accessKey + '> accesskey = <' + node.getAttribute('accesskey') + '> oldaccesskey = <' + node.getAttribute('oldaccesskey') + '>\n');
33 }
34
35 dump('exiting util/widgets.js\n');