From 1d3b8ff78eaa3d64a839ba34af34d1e8b24f82af Mon Sep 17 00:00:00 2001 From: Scott González Date: Thu, 16 May 2013 06:26:03 -0400 Subject: Position: Use absolute positioning when getting scrollbar width to avoid reflows of user content. Fixes #9291 - Position - $.position.scrollbarWidth detection causes layout issues. --- demos/position/default.html | 150 ++++++++++++++------------------------------ ui/jquery.ui.position.js | 2 +- 2 files changed, 47 insertions(+), 105 deletions(-) diff --git a/demos/position/default.html b/demos/position/default.html index ad5a3d874..f94d316e3 100644 --- a/demos/position/default.html +++ b/demos/position/default.html @@ -12,126 +12,68 @@ -
-

- This is the position parent element. -

-
- -
-

- to position -

-
- -
-

- to position 2 -

-
- -
- position... -
- my: - - +
+
+
+ +
-
- at: - - -
-
- collision: - - -
-
-
-

Use the form controls to configure the positioning, or drag the positioned element to modify its offset. -
Drag around the parent element to see collision detection in action.

-
+
+ diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index 2d3451c06..d45b24bb1 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -70,7 +70,7 @@ $.position = { return cachedScrollbarWidth; } var w1, w2, - div = $( "
" ), + div = $( "
" ), innerDiv = div.children()[0]; $( "body" ).append( div ); -- cgit v1.2.3 From 0da5f9946d0a87f3bdd47cf8848fd63956e261d3 Mon Sep 17 00:00:00 2001 From: Scott González Date: Thu, 16 May 2013 08:32:58 -0400 Subject: Revert "Position: Use absolute positioning when getting scrollbar width to avoid reflows of user content. Fixes #9291 - Position - $.position.scrollbarWidth detection causes layout issues." This reverts commit 1d3b8ff78eaa3d64a839ba34af34d1e8b24f82af. --- demos/position/default.html | 150 ++++++++++++++++++++++++++++++-------------- ui/jquery.ui.position.js | 2 +- 2 files changed, 105 insertions(+), 47 deletions(-) diff --git a/demos/position/default.html b/demos/position/default.html index f94d316e3..ad5a3d874 100644 --- a/demos/position/default.html +++ b/demos/position/default.html @@ -12,68 +12,126 @@ -
-
-
- -
-
+
+

+ This is the position parent element. +

+
+ +
+

+ to position +

+
+ +
+

+ to position 2 +

+
-
+
+ position... +
+ my: + + +
+
+ at: + + +
+
+ collision: + + +
+
+
+

Use the form controls to configure the positioning, or drag the positioned element to modify its offset. +
Drag around the parent element to see collision detection in action.

+
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index d45b24bb1..2d3451c06 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -70,7 +70,7 @@ $.position = { return cachedScrollbarWidth; } var w1, w2, - div = $( "
" ), + div = $( "
" ), innerDiv = div.children()[0]; $( "body" ).append( div ); -- cgit v1.2.3 From d500e945a46c9e2ce5bbb685661c32b5d3f57d21 Mon Sep 17 00:00:00 2001 From: Scott González Date: Thu, 16 May 2013 08:34:04 -0400 Subject: Position: Use absolute positioning when getting scrollbar width to avoid reflows of user content. Fixes #9291 - Position - $.position.scrollbarWidth detection causes layout issues. --- ui/jquery.ui.position.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index 2d3451c06..d45b24bb1 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -70,7 +70,7 @@ $.position = { return cachedScrollbarWidth; } var w1, w2, - div = $( "
" ), + div = $( "
" ), innerDiv = div.children()[0]; $( "body" ).append( div ); -- cgit v1.2.3 From 2121a1008a91c03c1e28262dcf3edc9bd8e83a20 Mon Sep 17 00:00:00 2001 From: Scott González Date: Thu, 16 May 2013 10:08:47 -0400 Subject: Sortable demo (portlets): Cleanup. --- demos/sortable/portlets.html | 60 +++++++++++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/demos/sortable/portlets.html b/demos/sortable/portlets.html index 5a3f2b662..a9f7c1eea 100644 --- a/demos/sortable/portlets.html +++ b/demos/sortable/portlets.html @@ -11,34 +11,58 @@ -- cgit v1.2.3 From 9726cd72b64e9e9735cfdb5564ebef64a6dab0aa Mon Sep 17 00:00:00 2001 From: Scott González Date: Thu, 16 May 2013 12:14:05 -0400 Subject: Datepicker i18n: Updated Spanish and French locales. Fixes #9289 - Datepicker: Incorrect capitalisation for French and Spanish. --- ui/i18n/jquery.ui.datepicker-es.js | 14 +++++++------- ui/i18n/jquery.ui.datepicker-fr-CH.js | 14 +++++++------- ui/i18n/jquery.ui.datepicker-fr.js | 12 ++++++------ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ui/i18n/jquery.ui.datepicker-es.js b/ui/i18n/jquery.ui.datepicker-es.js index 97a2d6ead..763d4cedd 100644 --- a/ui/i18n/jquery.ui.datepicker-es.js +++ b/ui/i18n/jquery.ui.datepicker-es.js @@ -6,13 +6,13 @@ jQuery(function($){ prevText: '<Ant', nextText: 'Sig>', currentText: 'Hoy', - monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio', - 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'], - monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun', - 'Jul','Ago','Sep','Oct','Nov','Dic'], - dayNames: ['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado'], - dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'], - dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'], + monthNames: ['enero','febrero','marzo','abril','mayo','junio', + 'julio','agosto','septiembre','octubre','noviembre','diciembre'], + monthNamesShort: ['ene','feb','mar','abr','may','jun', + 'jul','ogo','sep','oct','nov','dic'], + dayNames: ['domingo','lunes','martes','miércoles','jueves','viernes','sábado'], + dayNamesShort: ['dom','lun','mar','mié','juv','vie','sáb'], + dayNamesMin: ['D','L','M','X','J','V','S'], weekHeader: 'Sm', dateFormat: 'dd/mm/yy', firstDay: 1, diff --git a/ui/i18n/jquery.ui.datepicker-fr-CH.js b/ui/i18n/jquery.ui.datepicker-fr-CH.js index e574537b0..744fe1c3d 100644 --- a/ui/i18n/jquery.ui.datepicker-fr-CH.js +++ b/ui/i18n/jquery.ui.datepicker-fr-CH.js @@ -6,13 +6,13 @@ jQuery(function($){ prevText: '<Préc', nextText: 'Suiv>', currentText: 'Courant', - monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin', - 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'], - monthNamesShort: ['Jan','Fév','Mar','Avr','Mai','Jun', - 'Jul','Aoû','Sep','Oct','Nov','Déc'], - dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], - dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'], - dayNamesMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'], + monthNames: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', + 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'], + monthNamesShort: ['janv.', 'févr.', 'mars', 'avril', 'mai', 'juin', + 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'], + dayNames: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'], + dayNamesShort: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'], + dayNamesMin: ['D', 'L', 'M', 'M', 'J', 'V', 'S'], weekHeader: 'Sm', dateFormat: 'dd.mm.yy', firstDay: 1, diff --git a/ui/i18n/jquery.ui.datepicker-fr.js b/ui/i18n/jquery.ui.datepicker-fr.js index 934afd1d0..2d06743a6 100644 --- a/ui/i18n/jquery.ui.datepicker-fr.js +++ b/ui/i18n/jquery.ui.datepicker-fr.js @@ -8,12 +8,12 @@ jQuery(function($){ prevText: 'Précédent', nextText: 'Suivant', currentText: 'Aujourd\'hui', - monthNames: ['Janvier','Février','Mars','Avril','Mai','Juin', - 'Juillet','Août','Septembre','Octobre','Novembre','Décembre'], - monthNamesShort: ['Janv.','Févr.','Mars','Avril','Mai','Juin', - 'Juil.','Août','Sept.','Oct.','Nov.','Déc.'], - dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], - dayNamesShort: ['Dim.','Lun.','Mar.','Mer.','Jeu.','Ven.','Sam.'], + monthNames: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin', + 'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'], + monthNamesShort: ['janv.', 'févr.', 'mars', 'avril', 'mai', 'juin', + 'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'], + dayNames: ['dimanche', 'lundi', 'mardi', 'mercredi', 'jeudi', 'vendredi', 'samedi'], + dayNamesShort: ['dim.', 'lun.', 'mar.', 'mer.', 'jeu.', 'ven.', 'sam.'], dayNamesMin: ['D','L','M','M','J','V','S'], weekHeader: 'Sem.', dateFormat: 'dd/mm/yy', -- cgit v1.2.3 From 2eb89f07341a557084fa3363fe22afe62530654d Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 20 May 2013 11:30:49 -0400 Subject: Widget: Properly set widgetEventPrefix when redefining a widget. Fixes #9316 - Widget: widgetEventPrefix is empty when widget is (occasionally) loaded twice. --- tests/unit/widget/widget_core.js | 10 ++++++++++ ui/jquery.ui.widget.js | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js index 0d97742ff..3268b756d 100644 --- a/tests/unit/widget/widget_core.js +++ b/tests/unit/widget/widget_core.js @@ -331,6 +331,16 @@ test( "re-init", function() { deepEqual( actions, [ "optionfoo", "init" ], "correct methods called on re-init with options" ); }); +test( "redeclare", function() { + expect( 2 ); + + $.widget( "ui.testWidget", {} ); + equal( $.ui.testWidget.prototype.widgetEventPrefix, "testWidget" ); + + $.widget( "ui.testWidget", {} ); + equal( $.ui.testWidget.prototype.widgetEventPrefix, "testWidget" ); +}); + test( "inheritance", function() { expect( 6 ); // #5830 - Widget: Using inheritance overwrites the base classes options diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index 741ac74d7..9fc0136c4 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -106,7 +106,7 @@ $.widget = function( name, base, prototype ) { // TODO: remove support for widgetEventPrefix // always use the name + a colon as the prefix, e.g., draggable:start // don't prefix for widgets that aren't DOM-based - widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name + widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name }, proxiedPrototype, { constructor: constructor, namespace: namespace, -- cgit v1.2.3 From 433ef9d433e9baa464cd0b313b82efa6f1d65556 Mon Sep 17 00:00:00 2001 From: David Hansen Date: Wed, 23 Jan 2013 11:46:10 -0700 Subject: Interactions: Fixed an off-by-one error in isOverAxis. --- tests/unit/droppable/droppable_methods.js | 31 ++++++++++++++++++++++++++++++- ui/jquery.ui.droppable.js | 2 +- ui/jquery.ui.sortable.js | 2 +- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/tests/unit/droppable/droppable_methods.js b/tests/unit/droppable/droppable_methods.js index f7682d262..ce3d8f72f 100644 --- a/tests/unit/droppable/droppable_methods.js +++ b/tests/unit/droppable/droppable_methods.js @@ -88,4 +88,33 @@ test( "disable", function() { equal( actual, expected, "disable is chainable" ); }); -})(jQuery); +test( "intersect", function() { + expect( 8 ); + + var actual, data, + draggable = $( "
" ).appendTo( "#qunit-fixture" ).css({ width: 10, height: 10, position: "absolute" }).draggable(), + droppable = $( "
" ).appendTo( "#qunit-fixture" ).css({ width: 10, height: 10, position: "absolute", top: 5, left: 5 }).droppable(), + dataset = [ + [ -1, -1, false, "too far up and left" ], + [ -1, 0, false, "too far left" ], + [ 0, -1, false, "too far up" ], + [ 0, 0, true, "top left corner" ], + [ 9, 9, true, "bottom right corner" ], + [ 10, 9, false, "too far right" ], + [ 9, 10, false, "too far down" ], + [ 10, 10, false, "too far down and right" ] + ], + x = 0; + + for ( ; x < dataset.length; x++ ) { + data = dataset[ x ]; + $( draggable ).simulate( "drag", { + dx: ( data[ 0 ] - $( draggable ).position().left ), + dy: ( data[ 1 ] - $( draggable ).position().top ) + }); + actual = $.ui.intersect( $( draggable ).draggable( "instance" ), $( droppable ).droppable( "instance" ), "pointer" ); + equal( actual, data[ 2 ], data[ 3 ] ); + } +}); + +})( jQuery ); diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js index 6bc4b594d..808009dc1 100644 --- a/ui/jquery.ui.droppable.js +++ b/ui/jquery.ui.droppable.js @@ -17,7 +17,7 @@ (function( $, undefined ) { function isOverAxis( x, reference, size ) { - return ( x > reference ) && ( x < ( reference + size ) ); + return ( x >= reference ) && ( x < ( reference + size ) ); } $.widget("ui.droppable", { diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index c7794f06a..9c7bf446c 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -16,7 +16,7 @@ (function( $, undefined ) { function isOverAxis( x, reference, size ) { - return ( x > reference ) && ( x < ( reference + size ) ); + return ( x >= reference ) && ( x < ( reference + size ) ); } function isFloating(item) { -- cgit v1.2.3 From 24756a978a977d7abbef5e5bce403837a01d964f Mon Sep 17 00:00:00 2001 From: Brian Grinstead Date: Mon, 14 Jun 2010 08:20:03 -0700 Subject: Draggable: enabled draggable from within iframe. Fixed #5727 - draggable: cannot drag element inside iframe --- tests/jquery.simulate.js | 2 +- tests/unit/draggable/draggable_core.js | 16 ++++++++++++++++ ui/jquery.ui.core.js | 2 +- ui/jquery.ui.draggable.js | 16 ++++++++++------ ui/jquery.ui.mouse.js | 20 +++++++++++++------- 5 files changed, 41 insertions(+), 15 deletions(-) diff --git a/tests/jquery.simulate.js b/tests/jquery.simulate.js index 0a0c42487..1dd96ac3a 100644 --- a/tests/jquery.simulate.js +++ b/tests/jquery.simulate.js @@ -313,7 +313,7 @@ $.extend( $.simulate.prototype, { clientY: Math.round( y ) }; - this.simulateEvent( document, "mousemove", coord ); + this.simulateEvent( target.ownerDocument, "mousemove", coord ); } if ( $.contains( document, target ) ) { diff --git a/tests/unit/draggable/draggable_core.js b/tests/unit/draggable/draggable_core.js index e7fcdfa87..e2dc2a481 100644 --- a/tests/unit/draggable/draggable_core.js +++ b/tests/unit/draggable/draggable_core.js @@ -169,4 +169,20 @@ test( "#5009: scroll not working with parent's position fixed", function() { }); }); +test( "#5727: draggable from iframe" , function() { + expect( 2 ); + + var iframe = $( "" ).appendTo( "#qunit-fixture" ), + iframeBody = iframe.contents().find( "body" ).append( + "
Relative
" + ), + draggable1 = iframeBody.find( "#iframe-draggable-1" ); + + draggable1.draggable(); + + equal( draggable1.closest( iframeBody ).length, 1 ); + + TestHelpers.draggable.shouldMove( draggable1 ); +}); + })( jQuery ); diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index 898ce10d8..9145d5d45 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -69,7 +69,7 @@ $.fn.extend({ }).eq(0); } - return (/fixed/).test(this.css("position")) || !scrollParent.length ? $(document) : scrollParent; + return ( /fixed/ ).test( this.css( "position") ) || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent; }, uniqueId: function() { diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 45b724fde..bf90d349b 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -325,7 +325,8 @@ $.widget("ui.draggable", $.ui.mouse, { _getParentOffset: function() { //Get the offsetParent and cache its position - var po = this.offsetParent.offset(); + var po = this.offsetParent.offset(), + document = this.document[ 0 ]; // This is a special case where we need to modify a offset calculated on start, since the following happened: // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent @@ -383,7 +384,8 @@ $.widget("ui.draggable", $.ui.mouse, { _setContainment: function() { var over, c, ce, - o = this.options; + o = this.options, + document = this.document[ 0 ]; if ( !o.containment ) { this.containment = null; @@ -444,6 +446,7 @@ $.widget("ui.draggable", $.ui.mouse, { } var mod = d === "absolute" ? 1 : -1, + document = this.document[ 0 ], scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent; //Cache the scroll @@ -472,6 +475,7 @@ $.widget("ui.draggable", $.ui.mouse, { var containment, co, top, left, o = this.options, + document = this.document[ 0 ], scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent, pageX = event.pageX, pageY = event.pageY; @@ -778,17 +782,17 @@ $.ui.plugin.add("draggable", "opacity", { $.ui.plugin.add("draggable", "scroll", { start: function( event, ui, i ) { - if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") { + if( i.scrollParent[ 0 ] !== i.document[ 0 ] && i.scrollParent[ 0 ].tagName !== "HTML" ) { i.overflowOffset = i.scrollParent.offset(); } }, drag: function( event, ui, i ) { var o = i.options, - scrolled = false; - - if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") { + scrolled = false, + document = i.document[ 0 ]; + if( i.scrollParent[ 0 ] !== document && i.scrollParent[ 0 ].tagName !== "HTML" ) { if(!o.axis || o.axis !== "x") { if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) { i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed; diff --git a/ui/jquery.ui.mouse.js b/ui/jquery.ui.mouse.js index df887d334..ca774e3da 100644 --- a/ui/jquery.ui.mouse.js +++ b/ui/jquery.ui.mouse.js @@ -48,7 +48,7 @@ $.widget("ui.mouse", { _mouseDestroy: function() { this.element.unbind("."+this.widgetName); if ( this._mouseMoveDelegate ) { - $(document) + this.document .unbind("mousemove."+this.widgetName, this._mouseMoveDelegate) .unbind("mouseup."+this.widgetName, this._mouseUpDelegate); } @@ -99,9 +99,10 @@ $.widget("ui.mouse", { this._mouseUpDelegate = function(event) { return that._mouseUp(event); }; - $(document) - .bind("mousemove."+this.widgetName, this._mouseMoveDelegate) - .bind("mouseup."+this.widgetName, this._mouseUpDelegate); + + this.document + .bind( "mousemove." + this.widgetName, this._mouseMoveDelegate ) + .bind( "mouseup." + this.widgetName, this._mouseUpDelegate ); event.preventDefault(); @@ -114,6 +115,10 @@ $.widget("ui.mouse", { if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) { return this._mouseUp(event); } + // Iframe mouseup check - mouseup occurred in another document + else if ( !event.which ) { + return this._mouseUp( event ); + } if (this._mouseStarted) { this._mouseDrag(event); @@ -130,9 +135,9 @@ $.widget("ui.mouse", { }, _mouseUp: function(event) { - $(document) - .unbind("mousemove."+this.widgetName, this._mouseMoveDelegate) - .unbind("mouseup."+this.widgetName, this._mouseUpDelegate); + this.document + .unbind( "mousemove." + this.widgetName, this._mouseMoveDelegate ) + .unbind( "mouseup." + this.widgetName, this._mouseUpDelegate ); if (this._mouseStarted) { this._mouseStarted = false; @@ -144,6 +149,7 @@ $.widget("ui.mouse", { this._mouseStop(event); } + mouseHandled = false; return false; }, -- cgit v1.2.3 From daf3f0d9af5b29dc090e15d57cf884e3c12f7cad Mon Sep 17 00:00:00 2001 From: Scott González Date: Wed, 22 May 2013 13:59:17 -0400 Subject: Tabs: Restore anchor cloning for remote tab testing. Fixes #9317 - Tabs: Incorrect remote tab detection in IE7. --- ui/jquery.ui.tabs.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index 992bd41b2..4362421db 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -22,6 +22,10 @@ function getNextTabId() { } function isLocal( anchor ) { + // support: IE7 + // IE7 doesn't normalize the href property when set via script (#9317) + anchor = anchor.cloneNode( false ); + return anchor.hash.length > 1 && decodeURIComponent( anchor.href.replace( rhash, "" ) ) === decodeURIComponent( location.href.replace( rhash, "" ) ); -- cgit v1.2.3 From c19e7b3496d14b40e71ba892213889fc8cc81d4f Mon Sep 17 00:00:00 2001 From: TJ VanToll Date: Wed, 22 May 2013 21:43:40 -0400 Subject: Dialog: Add type="button" to the close button. Fixed #9312: Dialog: closes on enter in textbox in IE. --- ui/jquery.ui.dialog.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index b01907acf..16095292c 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -342,7 +342,10 @@ $.widget( "ui.dialog", { } }); - this.uiDialogTitlebarClose = $("") + // support: IE + // Use type="button" to prevent enter keypresses in textboxes from closing the + // dialog in IE (#9312) + this.uiDialogTitlebarClose = $( "" ) .button({ label: this.options.closeText, icons: { -- cgit v1.2.3