Skip to content

Commit ec61e54

Browse files
committed
Merge branch 'master' into selectmenu
2 parents a156c2c + cceb163 commit ec61e54

File tree

11 files changed

+84
-43
lines changed

11 files changed

+84
-43
lines changed

.mailmap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Ben Hollis <bhollis@amazon.com> <ben@benhollis.net>
1111
Benjamin Scott Boyle <benjamins.boyle@gmail.com>
1212
Bert ter Heide <bertjh@hotmail.com>
1313
Chairat Sunthornwiphat <pipo@sixhead.com>
14+
Christoph Rönsch <christoph.roensch@arcor.de>
1415
Corey Frang <gnarf37@gmail.com> <gnarf@gnarf.net>
1516
Courtland Allen <courtlandallen@gmail.com>
1617
Dan Streetman <ddstreet@ieee.org>
@@ -64,6 +65,7 @@ Michael Wu <michaelmwu@gmail.com>
6465
Mike Alsup <malsup@gmail.com>
6566
Milan Broum <midlis@googlemail.com>
6667
Mohamed Cherif Bouchelaghem <cherifbouchelaghem@yahoo.fr> <cherif@cherif.(none)>
68+
Nick Pierpoint <nick.pierpoint@tidalsand.com>
6769
Paul Irish <paul.irish@gmail.com>
6870
Pavol Hluchý <lopo@losys.sk>
6971
Peter Heiberg <peter@heiberg.se>

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[jQuery UI](http://jqueryui.com/) - Interactions and Widgets for the web
22
================================
33

4-
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.
4+
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.
55

6-
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.
6+
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.
77

88
If you are interested in helping develop jQuery UI, you are in the right place.
9-
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.
9+
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/).
1010

1111

1212
For contributors
@@ -91,7 +91,7 @@ If you need to edit the changes:
9191
# make changes
9292
git commit --author="[author-name-and-email]"
9393

94-
If it should go to the stable brach, cherry-pick it to stable:
94+
If it should go to the stable branch, cherry-pick it to stable:
9595

9696
git checkout 1-10-stable
9797
git cherry-pick -x [sha-of-commit-from-master]

tests/unit/dialog/dialog_methods.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,21 @@ test("destroy", function() {
6363
// Don't throw errors when destroying a never opened modal dialog (#9004)
6464
$( "#dialog1" ).dialog({ autoOpen: false, modal: true }).dialog( "destroy" );
6565
equal( $( ".ui-widget-overlay" ).length, 0, "overlay does not exist" );
66-
equal( $.ui.dialog.overlayInstances, 0, "overlayInstances equals the number of open overlays");
66+
equal( $( document ).data( "ui-dialog-overlays" ), undefined, "ui-dialog-overlays equals the number of open overlays");
6767

6868
element = $( "#dialog1" ).dialog({ modal: true }),
6969
element2 = $( "#dialog2" ).dialog({ modal: true });
7070
equal( $( ".ui-widget-overlay" ).length, 2, "overlays created when dialogs are open" );
71-
equal( $.ui.dialog.overlayInstances, 2, "overlayInstances equals the number of open overlays" );
71+
equal( $( document ).data( "ui-dialog-overlays" ), 2, "ui-dialog-overlays equals the number of open overlays" );
7272
element.dialog( "close" );
7373
equal( $( ".ui-widget-overlay" ).length, 1, "overlay remains after closing one dialog" );
74-
equal( $.ui.dialog.overlayInstances, 1, "overlayInstances equals the number of open overlays" );
74+
equal( $( document ).data( "ui-dialog-overlays" ), 1, "ui-dialog-overlays equals the number of open overlays" );
7575
element.dialog( "destroy" );
7676
equal( $( ".ui-widget-overlay" ).length, 1, "overlay remains after destroying one dialog" );
77-
equal( $.ui.dialog.overlayInstances, 1, "overlayInstances equals the number of open overlays" );
77+
equal( $( document ).data( "ui-dialog-overlays" ), 1, "ui-dialog-overlays equals the number of open overlays" );
7878
element2.dialog( "destroy" );
7979
equal( $( ".ui-widget-overlay" ).length, 0, "overlays removed when all dialogs are destoryed" );
80-
equal( $.ui.dialog.overlayInstances, 0, "overlayInstances equals the number of open overlays" );
80+
equal( $( document ).data( "ui-dialog-overlays" ), undefined, "ui-dialog-overlays equals the number of open overlays" );
8181
});
8282

8383
asyncTest("#9000: Dialog leaves broken event handler after close/destroy in certain cases", function() {

tests/unit/menu/menu_events.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,4 +619,19 @@ test( "ensure default is prevented when clicking on anchors in disabled menus ",
619619
equal( logOutput(), "click,1,afterclick,disable,enable,3", "Click order not valid." );
620620
});
621621

622+
test( "#9469: Stopping propagation in a select event should not suppress subsequent select events.", function() {
623+
expect( 1 );
624+
var element = $( "#menu1" ).menu({
625+
select: function( event ) {
626+
log();
627+
event.stopPropagation();
628+
}
629+
});
630+
631+
click( element, "1" );
632+
click( element, "2" );
633+
634+
equal( logOutput(), "1,2", "Both select events were not triggered." );
635+
});
636+
622637
})( jQuery );

tests/unit/widget/widget_core.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -615,12 +615,13 @@ test( ".disable()", function() {
615615
});
616616

617617
test( ".widget() - base", function() {
618-
expect( 1 );
619-
$.widget( "ui.testWidget", {
620-
_create: function() {}
621-
});
622-
var div = $( "<div>" ).testWidget();
618+
expect( 2 );
619+
var constructor = $.widget( "ui.testWidget", {
620+
_create: function() {}
621+
}),
622+
div = $( "<div>" ).testWidget();
623623
deepEqual( div[0], div.testWidget( "widget" )[0]);
624+
deepEqual( constructor, $.ui.testWidget, "$.widget returns the constructor" );
624625
});
625626

626627
test( ".widget() - overriden", function() {

themes/base/jquery.ui.theme.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@
7676
.ui-state-hover a,
7777
.ui-state-hover a:hover,
7878
.ui-state-hover a:link,
79-
.ui-state-hover a:visited {
79+
.ui-state-hover a:visited,
80+
.ui-state-focus a,
81+
.ui-state-focus a:hover,
82+
.ui-state-focus a:link,
83+
.ui-state-focus a:visited {
8084
color: #212121/*{fcHover}*/;
8185
text-decoration: none;
8286
}

ui/i18n/jquery.ui.datepicker-is.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jQuery(function($){
1414
dayNamesShort: ['Sun','Mán','Þri','Mið','Fim','Fös','Lau'],
1515
dayNamesMin: ['Su','Má','Þr','Mi','Fi','Fö','La'],
1616
weekHeader: 'Vika',
17-
dateFormat: 'dd/mm/yy',
17+
dateFormat: 'dd.mm.yy',
1818
firstDay: 0,
1919
isRTL: false,
2020
showMonthAfterYear: false,

ui/jquery.ui.dialog.js

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -724,22 +724,27 @@ $.widget( "ui.dialog", {
724724
return;
725725
}
726726

727-
var that = this,
728-
widgetFullName = this.widgetFullName;
729-
if ( !$.ui.dialog.overlayInstances ) {
730-
// Prevent use of anchors and inputs.
731-
// We use a delay in case the overlay is created from an
732-
// event that we're going to be cancelling. (#2804)
733-
this._delay(function() {
734-
// Handle .dialog().dialog("close") (#4065)
735-
if ( $.ui.dialog.overlayInstances ) {
736-
this.document.bind( "focusin.dialog", function( event ) {
737-
if ( !that._allowInteraction( event ) ) {
738-
event.preventDefault();
739-
$(".ui-dialog:visible:last .ui-dialog-content")
740-
.data( widgetFullName )._focusTabbable();
741-
}
742-
});
727+
// We use a delay in case the overlay is created from an
728+
// event that we're going to be cancelling (#2804)
729+
var isOpening = true;
730+
this._delay(function() {
731+
isOpening = false;
732+
});
733+
734+
if ( !this.document.data( "ui-dialog-overlays" ) ) {
735+
736+
// Prevent use of anchors and inputs
737+
this._on( this.document, {
738+
focusin: function( event ) {
739+
if ( isOpening ) {
740+
return;
741+
}
742+
743+
if ( !this._allowInteraction( event ) ) {
744+
event.preventDefault();
745+
this.document.find( ".ui-dialog:visible:last .ui-dialog-content" )
746+
.data( this.widgetFullName )._focusTabbable();
747+
}
743748
}
744749
});
745750
}
@@ -750,7 +755,8 @@ $.widget( "ui.dialog", {
750755
this._on( this.overlay, {
751756
mousedown: "_keepFocus"
752757
});
753-
$.ui.dialog.overlayInstances++;
758+
this.document.data( "ui-dialog-overlays",
759+
(this.document.data( "ui-dialog-overlays" ) || 0) + 1 );
754760
},
755761

756762
_destroyOverlay: function() {
@@ -759,17 +765,20 @@ $.widget( "ui.dialog", {
759765
}
760766

761767
if ( this.overlay ) {
762-
$.ui.dialog.overlayInstances--;
763-
764-
if ( !$.ui.dialog.overlayInstances ) {
765-
this.document.unbind( "focusin.dialog" );
768+
var overlays = this.document.data( "ui-dialog-overlays" ) - 1;
769+
770+
if ( !overlays ) {
771+
this.document
772+
.off( "focusin" )
773+
.removeData( "ui-dialog-overlays" );
774+
} else {
775+
this.document.data( "ui-dialog-overlays", overlays );
766776
}
777+
767778
this.overlay.remove();
768779
this.overlay = null;
769780
}
770781
}
771782
});
772783

773-
$.ui.dialog.overlayInstances = 0;
774-
775784
}( jQuery ) );

ui/jquery.ui.menu.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,13 @@ $.widget( "ui.menu", {
7575
"click .ui-menu-item:has(a)": function( event ) {
7676
var target = $( event.target ).closest( ".ui-menu-item" );
7777
if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) {
78-
this.mouseHandled = true;
79-
8078
this.select( event );
79+
80+
// Only set the mouseHandled flag if the event will bubble, see #9469.
81+
if ( !event.isPropagationStopped() ) {
82+
this.mouseHandled = true;
83+
}
84+
8185
// Open submenu on click
8286
if ( target.has( ".ui-menu" ).length ) {
8387
this.expand( event );
@@ -126,7 +130,7 @@ $.widget( "ui.menu", {
126130
// Clicks outside of a menu collapse any open menus
127131
this._on( this.document, {
128132
click: function( event ) {
129-
if ( !$( event.target ).closest( ".ui-menu" ).length ) {
133+
if ( this._closeOnDocumentClick( event ) ) {
130134
this.collapseAll( event );
131135
}
132136

@@ -498,6 +502,10 @@ $.widget( "ui.menu", {
498502
.removeClass( "ui-state-active" );
499503
},
500504

505+
_closeOnDocumentClick: function( event ) {
506+
return !$( event.target ).closest( ".ui-menu" ).length;
507+
},
508+
501509
collapse: function( event ) {
502510
var newItem = this.active &&
503511
this.active.parent().closest( ".ui-menu-item", this.element );

ui/jquery.ui.position.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ $.ui.position = {
436436
}
437437
}
438438
else if ( overBottom > 0 ) {
439-
newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
439+
newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
440440
if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) {
441441
position.top += myOffset + atOffset + offset;
442442
}

ui/jquery.ui.widget.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ $.widget = function( name, base, prototype ) {
134134
}
135135

136136
$.widget.bridge( name, constructor );
137+
138+
return constructor;
137139
};
138140

139141
$.widget.extend = function( target ) {

0 commit comments

Comments
 (0)