keyboard support
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 27 Jun 2006 04:37:59 +0000 (04:37 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 27 Jun 2006 04:37:59 +0000 (04:37 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@4799 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/cat/copy_editor.js
Open-ILS/xul/staff_client/server/skin/global.css

index 17e253f..6f00b23 100644 (file)
@@ -688,7 +688,7 @@ g.render = function() {
                                groupbox = document.createElement('groupbox'); document.getElementById(h).appendChild(groupbox);
                                if (typeof g.changed[fn] != 'undefined') groupbox.setAttribute('class','copy_editor_field_changed');
                                caption = document.createElement('caption'); groupbox.appendChild(caption);
-                               caption.setAttribute('label',fn);
+                               caption.setAttribute('label',fn); 
                                vbox = document.createElement('vbox'); groupbox.appendChild(vbox);
                                grid = util.widgets.make_grid( [ { 'flex' : 1 }, {}, {} ] ); vbox.appendChild(grid);
                                grid.setAttribute('flex','1');
@@ -738,6 +738,7 @@ g.render_input = function(node,blob) {
                // node = hbox ;    groupbox ->  hbox, hbox
 
                var groupbox = node.parentNode;
+               var caption = groupbox.firstChild;
                var vbox = node.previousSibling;
                var hbox = node;
                var hbox2 = node.nextSibling;
@@ -814,7 +815,13 @@ g.render_input = function(node,blob) {
                }
                vbox.addEventListener('click',on_click, false);
                hbox.addEventListener('click',on_click, false);
-               groupbox.firstChild.addEventListener('click',on_click, false);
+               caption.addEventListener('click',on_click, false);
+               caption.addEventListener('keypress',function(ev) {
+                       if (ev.keyCode == 13 /* enter */ || ev.keyCode == 77 /* mac enter */) on_click();
+               }, false);
+               caption.setAttribute('style','-moz-user-focus: normal');
+               caption.setAttribute('onfocus','this.setAttribute("class","outline_me")');
+               caption.setAttribute('onblur','this.setAttribute("class","")');
 
        } catch(E) {
                g.error.sdump('D_ERROR',E + '\n');
index 7eb2ddd..184d6a7 100644 (file)
@@ -6,6 +6,8 @@ description { -moz-user-select: text; }
 *|textarea:focus { background-color: #DDFFDD; }
 *|input:focus { background-color: #DDFFDD; }
 
+.outline_me { -moz-outline: solid; }
+
 tabpanel { border: 2px groove black; }
 caption { font-weight: bold; }