]> source.dussan.org Git - jquery-ui.git/commitdiff
Fixed #3655 - $.keyCode should be $.ui.keyCode
authorRichard Worth <rdworth@gmail.com>
Sun, 14 Dec 2008 06:11:37 +0000 (06:11 +0000)
committerRichard Worth <rdworth@gmail.com>
Sun, 14 Dec 2008 06:11:37 +0000 (06:11 +0000)
ui/ui.accordion.js
ui/ui.core.js
ui/ui.dialog.js

index 973c9706e1901e0ba15ffd3300ea3a56d8be7c7f..3072649466ebc489d2b0e9e1cc74ce02bb9c3b04 100644 (file)
@@ -115,7 +115,7 @@ $.widget("ui.accordion", {
                if (this.options.disabled || event.altKey || event.ctrlKey)
                        return;
 
-               var keyCode = $.keyCode;
+               var keyCode = $.ui.keyCode;
 
                var length = this.options.headers.length;
                var currentIndex = this.options.headers.index(event.target);
index 84a7fcbaeae19172f74a9e4e51d46c49f6fdc941..d447a14e74419db75e4e7825981465f976f59808 100644 (file)
@@ -9,40 +9,9 @@
  */
 ;(function($) {
 
-/** jQuery core modifications and additions **/
-$.keyCode = {
-       BACKSPACE: 8,
-       CAPS_LOCK: 20,
-       COMMA: 188,
-       CONTROL: 17,
-       DELETE: 46,
-       DOWN: 40,
-       END: 35,
-       ENTER: 13,
-       ESCAPE: 27,
-       HOME: 36,
-       INSERT: 45,
-       LEFT: 37,
-       NUMPAD_ADD: 107,
-       NUMPAD_DECIMAL: 110,
-       NUMPAD_DIVIDE: 111,
-       NUMPAD_ENTER: 108,
-       NUMPAD_MULTIPLY: 106,
-       NUMPAD_SUBTRACT: 109,
-       PAGE_DOWN: 34,
-       PAGE_UP: 33,
-       PERIOD: 190,
-       RIGHT: 39,
-       SHIFT: 16,
-       SPACE: 32,
-       TAB: 9,
-       UP: 38
-};
-
 var _remove = $.fn.remove,
        isFF2 = $.browser.mozilla && (parseFloat($.browser.version) < 1.9);
 
-
 //Helper functions and ui object
 $.ui = {
 
@@ -126,7 +95,37 @@ $.ui = {
        isOver: function(y, x, top, left, height, width) {
                //Determines when x, y coordinates is over "b" element
                return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
+       },
+
+       keyCode: {
+               BACKSPACE: 8,
+               CAPS_LOCK: 20,
+               COMMA: 188,
+               CONTROL: 17,
+               DELETE: 46,
+               DOWN: 40,
+               END: 35,
+               ENTER: 13,
+               ESCAPE: 27,
+               HOME: 36,
+               INSERT: 45,
+               LEFT: 37,
+               NUMPAD_ADD: 107,
+               NUMPAD_DECIMAL: 110,
+               NUMPAD_DIVIDE: 111,
+               NUMPAD_ENTER: 108,
+               NUMPAD_MULTIPLY: 106,
+               NUMPAD_SUBTRACT: 109,
+               PAGE_DOWN: 34,
+               PAGE_UP: 33,
+               PERIOD: 190,
+               RIGHT: 39,
+               SHIFT: 16,
+               SPACE: 32,
+               TAB: 9,
+               UP: 38
        }
+
 };
 
 // WAI-ARIA normalization
index 96414e7eb2bd202947e8572e96375476a3a09ddc..37e55927c7db24530df33fbf1d734d2a4cb534bc 100644 (file)
@@ -124,7 +124,7 @@ $.widget("ui.dialog", {
                                // setting outline to 0 prevents a border on focus in Mozilla
                                .attr('tabIndex', -1).css('outline', 0).keydown(function(ev) {
                                        (options.closeOnEscape && ev.keyCode
-                                               && ev.keyCode == $.keyCode.ESCAPE && self.close());
+                                               && ev.keyCode == $.ui.keyCode.ESCAPE && self.close());
                                })
                                .attr({
                                        role: 'dialog',
@@ -226,7 +226,7 @@ $.widget("ui.dialog", {
 
                // prevent tabbing out of modal dialogs
                (this.options.modal && this.uiDialog.bind('keypress.ui-dialog', function(event) {
-                       if (event.keyCode != $.keyCode.TAB) {
+                       if (event.keyCode != $.ui.keyCode.TAB) {
                                return;
                        }
 
@@ -508,7 +508,7 @@ $.extend($.ui.dialog.overlay, {
                        // allow closing by pressing the escape key
                        $(document).bind('keydown.dialog-overlay', function(event) {
                                (dialog.options.closeOnEscape && event.keyCode
-                                               && event.keyCode == $.keyCode.ESCAPE && dialog.close());
+                                               && event.keyCode == $.ui.keyCode.ESCAPE && dialog.close());
                        });
 
                        // handle window resize