summaryrefslogtreecommitdiff
path: root/resources/jquery.ui/jquery.ui.dialog.js
diff options
context:
space:
mode:
Diffstat (limited to 'resources/jquery.ui/jquery.ui.dialog.js')
-rw-r--r--resources/jquery.ui/jquery.ui.dialog.js45
1 files changed, 33 insertions, 12 deletions
diff --git a/resources/jquery.ui/jquery.ui.dialog.js b/resources/jquery.ui/jquery.ui.dialog.js
index f0656a2f..33119af2 100644
--- a/resources/jquery.ui/jquery.ui.dialog.js
+++ b/resources/jquery.ui/jquery.ui.dialog.js
@@ -1,5 +1,5 @@
/*
- * jQuery UI Dialog 1.8.11
+ * jQuery UI Dialog 1.8.17
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
@@ -37,6 +37,18 @@ var uiDialogClasses =
maxWidth: true,
minHeight: true,
minWidth: true
+ },
+ // support for jQuery 1.3.2 - handle common attrFn methods for dialog
+ attrFn = $.attrFn || {
+ val: true,
+ css: true,
+ html: true,
+ text: true,
+ data: true,
+ width: true,
+ height: true,
+ offset: true,
+ click: true
};
$.widget("ui.dialog", {
@@ -98,7 +110,7 @@ $.widget("ui.dialog", {
// setting tabIndex makes the div focusable
// setting outline to 0 prevents a border on focus in Mozilla
.attr('tabIndex', -1).css('outline', 0).keydown(function(event) {
- if (options.closeOnEscape && event.keyCode &&
+ if (options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
event.keyCode === $.ui.keyCode.ESCAPE) {
self.close(event);
@@ -294,7 +306,7 @@ $.widget("ui.dialog", {
//Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed.
// http://ui.jquery.com/bugs/ticket/3193
- saveScroll = { scrollTop: self.element.attr('scrollTop'), scrollLeft: self.element.attr('scrollLeft') };
+ saveScroll = { scrollTop: self.element.scrollTop(), scrollLeft: self.element.scrollLeft() };
$.ui.dialog.maxZ += 1;
self.uiDialog.css('z-index', $.ui.dialog.maxZ);
self.element.attr(saveScroll);
@@ -317,9 +329,9 @@ $.widget("ui.dialog", {
self.moveToTop(true);
// prevent tabbing out of modal dialogs
- if (options.modal) {
- uiDialog.bind('keypress.ui-dialog', function(event) {
- if (event.keyCode !== $.ui.keyCode.TAB) {
+ if ( options.modal ) {
+ uiDialog.bind( "keydown.ui-dialog", function( event ) {
+ if ( event.keyCode !== $.ui.keyCode.TAB ) {
return;
}
@@ -376,12 +388,21 @@ $.widget("ui.dialog", {
{ click: props, text: name } :
props;
var button = $('<button type="button"></button>')
- .attr( props, true )
- .unbind('click')
.click(function() {
props.click.apply(self.element[0], arguments);
})
.appendTo(uiButtonSet);
+ // can't use .attr( props, true ) with jQuery 1.3.2.
+ $.each( props, function( key, value ) {
+ if ( key === "click" ) {
+ return;
+ }
+ if ( key in attrFn ) {
+ button[ key ]( value );
+ } else {
+ button.attr( key, value );
+ }
+ });
if ($.fn.button) {
button.button();
}
@@ -681,7 +702,7 @@ $.widget("ui.dialog", {
});
$.extend($.ui.dialog, {
- version: "1.8.11",
+ version: "1.8.17",
uuid: 0,
maxZ: 0,
@@ -727,7 +748,7 @@ $.extend($.ui.dialog.overlay, {
// allow closing by pressing the escape key
$(document).bind('keydown.dialog-overlay', function(event) {
- if (dialog.options.closeOnEscape && event.keyCode &&
+ if (dialog.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode &&
event.keyCode === $.ui.keyCode.ESCAPE) {
dialog.close(event);
@@ -802,8 +823,8 @@ $.extend($.ui.dialog.overlay, {
width: function() {
var scrollWidth,
offsetWidth;
- // handle IE 6
- if ($.browser.msie && $.browser.version < 7) {
+ // handle IE
+ if ( $.browser.msie ) {
scrollWidth = Math.max(
document.documentElement.scrollWidth,
document.body.scrollWidth