Skip to content
Permalink
Browse files

Fixed #3655 - $.keyCode should be $.ui.keyCode

  • Loading branch information
rdworth committed Dec 14, 2008
1 parent eeccae3 commit ff64790b183a72cfebf2ecd0d91a3ac53160a57c
Showing with 34 additions and 35 deletions.
  1. +1 −1 ui/ui.accordion.js
  2. +30 −31 ui/ui.core.js
  3. +3 −3 ui/ui.dialog.js
@@ -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);
@@ -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
@@ -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

0 comments on commit ff64790

Please sign in to comment.
You can’t perform that action at this time.