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

This commit is contained in:
Richard Worth 2008-12-14 06:11:37 +00:00
parent eeccae3671
commit ff64790b18
3 changed files with 34 additions and 35 deletions

View 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);

View 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

View 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