From c4c90f385a77ab106a47cf56e53bcd352aa9edce Mon Sep 17 00:00:00 2001 From: TJ VanToll Date: Tue, 30 Jul 2013 06:41:35 -0400 Subject: Update the project's description as well as fix a few spelling / grammatical issues. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cc6121d5d..33b3907a5 100644 --- a/README.md +++ b/README.md @@ -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] -- cgit v1.2.3 From c0ab71056b936627e8a7821f03c044aec6280a40 Mon Sep 17 00:00:00 2001 From: Alexander Schmitz Date: Wed, 31 Jul 2013 15:56:04 -0400 Subject: Widget Factory: Make $.widget return the constructor. Fixes #9467 - Widget factory: Return the constructor from $.widget(). --- tests/unit/widget/widget_core.js | 5 +++-- ui/jquery.ui.widget.js | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js index 3268b756d..aff07cc35 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", { + expect( 2 ); + var constructor = $.widget( "ui.testWidget", { _create: function() {} }); var div = $( "
" ).testWidget(); deepEqual( div[0], div.testWidget( "widget" )[0]); + deepEqual( constructor, $.ui.testWidget, "$.widget returns the constructor" ); }); test( ".widget() - overriden", function() { 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 ) { -- cgit v1.2.3 From 787d607f8efebcfc5323a7c47a7a2cc4565327c6 Mon Sep 17 00:00:00 2001 From: Alexander Schmitz Date: Wed, 31 Jul 2013 17:08:30 -0400 Subject: Widget Factory: Fix multiple var statements in test --- tests/unit/widget/widget_core.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js index aff07cc35..3db79ec06 100644 --- a/tests/unit/widget/widget_core.js +++ b/tests/unit/widget/widget_core.js @@ -617,9 +617,9 @@ test( ".disable()", function() { test( ".widget() - base", function() { expect( 2 ); var constructor = $.widget( "ui.testWidget", { - _create: function() {} - }); - var div = $( "
" ).testWidget(); + _create: function() {} + }), + div = $( "
" ).testWidget(); deepEqual( div[0], div.testWidget( "widget" )[0]); deepEqual( constructor, $.ui.testWidget, "$.widget returns the constructor" ); }); -- cgit v1.2.3 From 369c76d9e62fd3bac4676801d5666e6b40a068a2 Mon Sep 17 00:00:00 2001 From: Vilhjálmur Skúlason Date: Thu, 1 Aug 2013 15:38:38 -0400 Subject: Datepicker: Fixed Icelandic locale. Fixes #9431 - Datepicker: Wrong dateformat for Icelandic datepicker locale. --- ui/i18n/jquery.ui.datepicker-is.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, -- cgit v1.2.3 From a3770884ac997169b810b3f6fda6df54a9cbbeeb Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Fri, 2 Aug 2013 13:15:58 +0200 Subject: Position: Replace double space with single space. --- 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 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; } -- cgit v1.2.3 From 484e382259f1c1c56b151a97ddf8a894f94d17ea Mon Sep 17 00:00:00 2001 From: TJ VanToll Date: Fri, 2 Aug 2013 06:51:04 -0400 Subject: Menu: Only set the mouseHandled flag if the event is going to bubble. Fixes #9469: on( "menuselect" ) not firing every time. --- tests/unit/menu/menu_events.js | 15 +++++++++++++++ ui/jquery.ui.menu.js | 8 ++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/tests/unit/menu/menu_events.js b/tests/unit/menu/menu_events.js index 554c4c516..4b152dcf4 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, ui ) { + log(); + event.stopPropagation(); + } + }); + + click( element, "1" ); + click( element, "2" ); + + equal( logOutput(), "1,2", "Both select events were not triggered." ); +}); + })( jQuery ); diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index c0222629d..b4f0d48c1 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 ); -- cgit v1.2.3 From afdf8986591e19404a9b67d1053ce292d754d841 Mon Sep 17 00:00:00 2001 From: TJ VanToll Date: Sat, 3 Aug 2013 17:52:11 -0400 Subject: Menu tests: jshint cleanup of unused argument --- tests/unit/menu/menu_events.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/menu/menu_events.js b/tests/unit/menu/menu_events.js index 4b152dcf4..405300c46 100644 --- a/tests/unit/menu/menu_events.js +++ b/tests/unit/menu/menu_events.js @@ -622,7 +622,7 @@ test( "ensure default is prevented when clicking on anchors in disabled menus ", test( "#9469: Stopping propagation in a select event should not suppress subsequent select events.", function() { expect( 1 ); var element = $( "#menu1" ).menu({ - select: function( event, ui ) { + select: function( event ) { log(); event.stopPropagation(); } -- cgit v1.2.3 From 8f45d2d9ac7b2925cff7b9d9b48cbb87caaf7327 Mon Sep 17 00:00:00 2001 From: Scott González Date: Tue, 6 Aug 2013 09:04:02 -0400 Subject: Mailmap: Fix Christoph Rönsch. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index 4158c202c..a97ac9f6e 100644 --- a/.mailmap +++ b/.mailmap @@ -11,6 +11,7 @@ Ben Hollis Benjamin Scott Boyle Bert ter Heide Chairat Sunthornwiphat +Christoph Rönsch Corey Frang Courtland Allen Dan Streetman -- cgit v1.2.3 From 92d54213958561ea1cfcdbaaaa53bbb6037a1e86 Mon Sep 17 00:00:00 2001 From: Scott González Date: Tue, 6 Aug 2013 09:22:27 -0400 Subject: Mailmap: Fix Nick Pierpoint. --- .mailmap | 1 + 1 file changed, 1 insertion(+) diff --git a/.mailmap b/.mailmap index a97ac9f6e..4810be8e4 100644 --- a/.mailmap +++ b/.mailmap @@ -65,6 +65,7 @@ Michael Wu Mike Alsup Milan Broum Mohamed Cherif Bouchelaghem +Nick Pierpoint Paul Irish Pavol Hluchý Peter Heiberg -- cgit v1.2.3 From c9815f13b487d027ef9b6095588dbb73141c9a09 Mon Sep 17 00:00:00 2001 From: Scott González Date: Tue, 6 Aug 2013 15:06:08 -0400 Subject: Dialog: Search the correct document for focus trapping. Fixes #9439 - Dialog: Context is not respected for modals. --- tests/unit/dialog/dialog_methods.js | 10 +++---- ui/jquery.ui.dialog.js | 55 +++++++++++++++++++++---------------- 2 files changed, 37 insertions(+), 28 deletions(-) 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/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 ) ); -- cgit v1.2.3 From 5aa106a052e78559e50a4ca464863f5927c43bd5 Mon Sep 17 00:00:00 2001 From: TJ VanToll Date: Thu, 18 Jul 2013 21:19:38 -0400 Subject: CSS Framework: Display child links within .ui-state-hover and .ui-state-focus widgets the same. Fixes #9428 - CSS Framework: Title color not reset in a focused accordion tab --- themes/base/jquery.ui.theme.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3 From cceb163548eea78525a3a60ada95a5af6e3ddf25 Mon Sep 17 00:00:00 2001 From: Kris Borchers Date: Wed, 31 Jul 2013 20:20:13 -0500 Subject: Menu: Make check for click outside of menu a function which can be overridden. Fixes #8929 - Menu needs adjustement for use in Selectmenu --- ui/jquery.ui.menu.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index b4f0d48c1..3352eb8bd 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -130,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 ); } @@ -502,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 ); -- cgit v1.2.3