diff options
author | Kris Borchers <kris.borchers@gmail.com> | 2013-08-11 19:16:41 -0500 |
---|---|---|
committer | Kris Borchers <kris.borchers@gmail.com> | 2013-08-11 19:16:41 -0500 |
commit | ec61e54e6fcfe33adab09d1ecad8db2edcbad4cc (patch) | |
tree | 1621f4ff0e398ba21defa824817caa8391756984 | |
parent | a156c2cadc81acf0856feb95ad41fe5f1a38315e (diff) | |
parent | cceb163548eea78525a3a60ada95a5af6e3ddf25 (diff) | |
download | jquery-ui-ec61e54e6fcfe33adab09d1ecad8db2edcbad4cc.tar.gz jquery-ui-ec61e54e6fcfe33adab09d1ecad8db2edcbad4cc.zip |
Merge branch 'master' into selectmenu
-rw-r--r-- | .mailmap | 2 | ||||
-rw-r--r-- | README.md | 8 | ||||
-rw-r--r-- | tests/unit/dialog/dialog_methods.js | 10 | ||||
-rw-r--r-- | tests/unit/menu/menu_events.js | 15 | ||||
-rw-r--r-- | tests/unit/widget/widget_core.js | 11 | ||||
-rw-r--r-- | themes/base/jquery.ui.theme.css | 6 | ||||
-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 |
11 files changed, 84 insertions, 43 deletions
@@ -11,6 +11,7 @@ Ben Hollis <bhollis@amazon.com> <ben@benhollis.net> Benjamin Scott Boyle <benjamins.boyle@gmail.com> Bert ter Heide <bertjh@hotmail.com> Chairat Sunthornwiphat <pipo@sixhead.com> +Christoph Rönsch <christoph.roensch@arcor.de> Corey Frang <gnarf37@gmail.com> <gnarf@gnarf.net> Courtland Allen <courtlandallen@gmail.com> Dan Streetman <ddstreet@ieee.org> @@ -64,6 +65,7 @@ Michael Wu <michaelmwu@gmail.com> Mike Alsup <malsup@gmail.com> Milan Broum <midlis@googlemail.com> Mohamed Cherif Bouchelaghem <cherifbouchelaghem@yahoo.fr> <cherif@cherif.(none)> +Nick Pierpoint <nick.pierpoint@tidalsand.com> Paul Irish <paul.irish@gmail.com> Pavol Hluchý <lopo@losys.sk> Peter Heiberg <peter@heiberg.se> @@ -1,12 +1,12 @@ [jQuery UI](http://jqueryui.com/) - Interactions and Widgets for the web ================================ -jQuery UI provides interactions like Drag and Drop and widgets like Autocomplete, Tabs and Slider and makes these as easy to use as jQuery itself. +jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of jQuery. Whether you're building highly interactive web applications, or you just need to add a date picker to a form control, jQuery UI is the perfect choice. -If you want to use jQuery UI, go to [jqueryui.com](http://jqueryui.com) to get started. Or visit the [Using jQuery UI Forum](http://forum.jquery.com/using-jquery-ui) for discussions and questions. +If you want to use jQuery UI, go to [jqueryui.com](http://jqueryui.com) to get started, [jqueryui.com/demos/](http://jqueryui.com/demos/) for demos, [api.jqueryui.com](http://api.jqueryui.com/) for API documentation, or the [Using jQuery UI Forum](http://forum.jquery.com/using-jquery-ui) for discussions and questions. If you are interested in helping develop jQuery UI, you are in the right place. -To discuss development with team members and the community, visit the [Developing jQuery UI Forum](http://forum.jquery.com/developing-jquery-ui) or in #jquery on irc.freednode.net. +To discuss development with team members and the community, visit the [Developing jQuery UI Forum](http://forum.jquery.com/developing-jquery-ui) or [#jqueryui-dev on irc.freenode.net](http://irc.jquery.org/). For contributors @@ -91,7 +91,7 @@ If you need to edit the changes: # make changes git commit --author="[author-name-and-email]" -If it should go to the stable brach, cherry-pick it to stable: +If it should go to the stable branch, cherry-pick it to stable: git checkout 1-10-stable git cherry-pick -x [sha-of-commit-from-master] diff --git a/tests/unit/dialog/dialog_methods.js b/tests/unit/dialog/dialog_methods.js index 2bb06ab46..60a7aa4d8 100644 --- a/tests/unit/dialog/dialog_methods.js +++ b/tests/unit/dialog/dialog_methods.js @@ -63,21 +63,21 @@ test("destroy", function() { // Don't throw errors when destroying a never opened modal dialog (#9004) $( "#dialog1" ).dialog({ autoOpen: false, modal: true }).dialog( "destroy" ); equal( $( ".ui-widget-overlay" ).length, 0, "overlay does not exist" ); - equal( $.ui.dialog.overlayInstances, 0, "overlayInstances equals the number of open overlays"); + equal( $( document ).data( "ui-dialog-overlays" ), undefined, "ui-dialog-overlays equals the number of open overlays"); element = $( "#dialog1" ).dialog({ modal: true }), element2 = $( "#dialog2" ).dialog({ modal: true }); equal( $( ".ui-widget-overlay" ).length, 2, "overlays created when dialogs are open" ); - equal( $.ui.dialog.overlayInstances, 2, "overlayInstances equals the number of open overlays" ); + equal( $( document ).data( "ui-dialog-overlays" ), 2, "ui-dialog-overlays equals the number of open overlays" ); element.dialog( "close" ); equal( $( ".ui-widget-overlay" ).length, 1, "overlay remains after closing one dialog" ); - equal( $.ui.dialog.overlayInstances, 1, "overlayInstances equals the number of open overlays" ); + equal( $( document ).data( "ui-dialog-overlays" ), 1, "ui-dialog-overlays equals the number of open overlays" ); element.dialog( "destroy" ); equal( $( ".ui-widget-overlay" ).length, 1, "overlay remains after destroying one dialog" ); - equal( $.ui.dialog.overlayInstances, 1, "overlayInstances equals the number of open overlays" ); + equal( $( document ).data( "ui-dialog-overlays" ), 1, "ui-dialog-overlays equals the number of open overlays" ); element2.dialog( "destroy" ); equal( $( ".ui-widget-overlay" ).length, 0, "overlays removed when all dialogs are destoryed" ); - equal( $.ui.dialog.overlayInstances, 0, "overlayInstances equals the number of open overlays" ); + equal( $( document ).data( "ui-dialog-overlays" ), undefined, "ui-dialog-overlays equals the number of open overlays" ); }); asyncTest("#9000: Dialog leaves broken event handler after close/destroy in certain cases", function() { diff --git a/tests/unit/menu/menu_events.js b/tests/unit/menu/menu_events.js index 554c4c516..405300c46 100644 --- a/tests/unit/menu/menu_events.js +++ b/tests/unit/menu/menu_events.js @@ -619,4 +619,19 @@ test( "ensure default is prevented when clicking on anchors in disabled menus ", equal( logOutput(), "click,1,afterclick,disable,enable,3", "Click order not valid." ); }); +test( "#9469: Stopping propagation in a select event should not suppress subsequent select events.", function() { + expect( 1 ); + var element = $( "#menu1" ).menu({ + select: function( event ) { + log(); + event.stopPropagation(); + } + }); + + click( element, "1" ); + click( element, "2" ); + + equal( logOutput(), "1,2", "Both select events were not triggered." ); +}); + })( jQuery ); diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js index 3268b756d..3db79ec06 100644 --- a/tests/unit/widget/widget_core.js +++ b/tests/unit/widget/widget_core.js @@ -615,12 +615,13 @@ test( ".disable()", function() { }); test( ".widget() - base", function() { - expect( 1 ); - $.widget( "ui.testWidget", { - _create: function() {} - }); - var div = $( "<div>" ).testWidget(); + expect( 2 ); + var constructor = $.widget( "ui.testWidget", { + _create: function() {} + }), + div = $( "<div>" ).testWidget(); deepEqual( div[0], div.testWidget( "widget" )[0]); + deepEqual( constructor, $.ui.testWidget, "$.widget returns the constructor" ); }); test( ".widget() - overriden", function() { diff --git a/themes/base/jquery.ui.theme.css b/themes/base/jquery.ui.theme.css index 2c3004392..71bd15664 100644 --- a/themes/base/jquery.ui.theme.css +++ b/themes/base/jquery.ui.theme.css @@ -76,7 +76,11 @@ .ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, -.ui-state-hover a:visited { +.ui-state-hover a:visited, +.ui-state-focus a, +.ui-state-focus a:hover, +.ui-state-focus a:link, +.ui-state-focus a:visited { color: #212121/*{fcHover}*/; text-decoration: none; } 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 ) { |