diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/i18n/jquery.ui.datepicker-is.js | 2 | ||||
-rw-r--r-- | ui/jquery.ui.dialog.js | 55 | ||||
-rw-r--r-- | ui/jquery.ui.menu.js | 14 | ||||
-rw-r--r-- | ui/jquery.ui.position.js | 2 | ||||
-rw-r--r-- | ui/jquery.ui.widget.js | 2 |
5 files changed, 47 insertions, 28 deletions
diff --git a/ui/i18n/jquery.ui.datepicker-is.js b/ui/i18n/jquery.ui.datepicker-is.js index 925341a7a..4fc429888 100644 --- a/ui/i18n/jquery.ui.datepicker-is.js +++ b/ui/i18n/jquery.ui.datepicker-is.js @@ -14,7 +14,7 @@ jQuery(function($){ dayNamesShort: ['Sun','Mán','Þri','Mið','Fim','Fös','Lau'], dayNamesMin: ['Su','Má','Þr','Mi','Fi','Fö','La'], weekHeader: 'Vika', - dateFormat: 'dd/mm/yy', + dateFormat: 'dd.mm.yy', firstDay: 0, isRTL: false, showMonthAfterYear: false, diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index b94757505..4279d357c 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -724,22 +724,27 @@ $.widget( "ui.dialog", { return; } - var that = this, - widgetFullName = this.widgetFullName; - if ( !$.ui.dialog.overlayInstances ) { - // Prevent use of anchors and inputs. - // We use a delay in case the overlay is created from an - // event that we're going to be cancelling. (#2804) - this._delay(function() { - // Handle .dialog().dialog("close") (#4065) - if ( $.ui.dialog.overlayInstances ) { - this.document.bind( "focusin.dialog", function( event ) { - if ( !that._allowInteraction( event ) ) { - event.preventDefault(); - $(".ui-dialog:visible:last .ui-dialog-content") - .data( widgetFullName )._focusTabbable(); - } - }); + // We use a delay in case the overlay is created from an + // event that we're going to be cancelling (#2804) + var isOpening = true; + this._delay(function() { + isOpening = false; + }); + + if ( !this.document.data( "ui-dialog-overlays" ) ) { + + // Prevent use of anchors and inputs + this._on( this.document, { + focusin: function( event ) { + if ( isOpening ) { + return; + } + + if ( !this._allowInteraction( event ) ) { + event.preventDefault(); + this.document.find( ".ui-dialog:visible:last .ui-dialog-content" ) + .data( this.widgetFullName )._focusTabbable(); + } } }); } @@ -750,7 +755,8 @@ $.widget( "ui.dialog", { this._on( this.overlay, { mousedown: "_keepFocus" }); - $.ui.dialog.overlayInstances++; + this.document.data( "ui-dialog-overlays", + (this.document.data( "ui-dialog-overlays" ) || 0) + 1 ); }, _destroyOverlay: function() { @@ -759,17 +765,20 @@ $.widget( "ui.dialog", { } if ( this.overlay ) { - $.ui.dialog.overlayInstances--; - - if ( !$.ui.dialog.overlayInstances ) { - this.document.unbind( "focusin.dialog" ); + var overlays = this.document.data( "ui-dialog-overlays" ) - 1; + + if ( !overlays ) { + this.document + .off( "focusin" ) + .removeData( "ui-dialog-overlays" ); + } else { + this.document.data( "ui-dialog-overlays", overlays ); } + this.overlay.remove(); this.overlay = null; } } }); -$.ui.dialog.overlayInstances = 0; - }( jQuery ) ); diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index c0222629d..3352eb8bd 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -75,9 +75,13 @@ $.widget( "ui.menu", { "click .ui-menu-item:has(a)": function( event ) { var target = $( event.target ).closest( ".ui-menu-item" ); if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) { - this.mouseHandled = true; - this.select( event ); + + // Only set the mouseHandled flag if the event will bubble, see #9469. + if ( !event.isPropagationStopped() ) { + this.mouseHandled = true; + } + // Open submenu on click if ( target.has( ".ui-menu" ).length ) { this.expand( event ); @@ -126,7 +130,7 @@ $.widget( "ui.menu", { // Clicks outside of a menu collapse any open menus this._on( this.document, { click: function( event ) { - if ( !$( event.target ).closest( ".ui-menu" ).length ) { + if ( this._closeOnDocumentClick( event ) ) { this.collapseAll( event ); } @@ -498,6 +502,10 @@ $.widget( "ui.menu", { .removeClass( "ui-state-active" ); }, + _closeOnDocumentClick: function( event ) { + return !$( event.target ).closest( ".ui-menu" ).length; + }, + collapse: function( event ) { var newItem = this.active && this.active.parent().closest( ".ui-menu-item", this.element ); diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index d45b24bb1..21c3cef1b 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -436,7 +436,7 @@ $.ui.position = { } } else if ( overBottom > 0 ) { - newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; + newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) { position.top += myOffset + atOffset + offset; } diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index 93daaf1ca..885e2019f 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -134,6 +134,8 @@ $.widget = function( name, base, prototype ) { } $.widget.bridge( name, constructor ); + + return constructor; }; $.widget.extend = function( target ) { |