Skip to content
Permalink
Browse files

Merge branch 'master' into selectmenu

  • Loading branch information
kborchers committed Aug 12, 2013
2 parents a156c2c + cceb163 commit ec61e54e6fcfe33adab09d1ecad8db2edcbad4cc
@@ -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]
@@ -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() {
@@ -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 );
@@ -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() {
@@ -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;
}
@@ -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,
@@ -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 ) );
@@ -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 );
@@ -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;
}
@@ -134,6 +134,8 @@ $.widget = function( name, base, prototype ) {
}

$.widget.bridge( name, constructor );

return constructor;
};

$.widget.extend = function( target ) {

0 comments on commit ec61e54

Please sign in to comment.
You can’t perform that action at this time.