Update jQuery UI to 1.11.2.

Changelog: http://jqueryui.com/changelog/1.11.2/

see #29833.

git-svn-id: https://develop.svn.wordpress.org/trunk@29920 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2014-10-16 19:01:44 +00:00
parent 935bc467b5
commit f3eb0eacc6
38 changed files with 565 additions and 358 deletions

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Accordion 1.11.1
* jQuery UI Accordion 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -25,7 +25,7 @@
}(function( $ ) {
return $.widget( "ui.accordion", {
version: "1.11.1",
version: "1.11.2",
options: {
active: 0,
animate: {},
@ -259,13 +259,22 @@ return $.widget( "ui.accordion", {
},
_processPanels: function() {
var prevHeaders = this.headers,
prevPanels = this.panels;
this.headers = this.element.find( this.options.header )
.addClass( "ui-accordion-header ui-state-default ui-corner-all" );
this.headers.next()
this.panels = this.headers.next()
.addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
.filter( ":not(.ui-accordion-content-active)" )
.hide();
// Avoid memory leaks (#10056)
if ( prevPanels ) {
this._off( prevHeaders.not( this.headers ) );
this._off( prevPanels.not( this.panels ) );
}
},
_refresh: function() {

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Autocomplete 1.11.1
* jQuery UI Autocomplete 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -27,7 +27,7 @@
}(function( $ ) {
$.widget( "ui.autocomplete", {
version: "1.11.1",
version: "1.11.2",
defaultElement: "<input>",
options: {
appendTo: null,

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Button 1.11.1
* jQuery UI Button 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -52,7 +52,7 @@ var lastActive,
};
$.widget( "ui.button", {
version: "1.11.1",
version: "1.11.2",
defaultElement: "<button>",
options: {
disabled: null,
@ -348,7 +348,7 @@ $.widget( "ui.button", {
});
$.widget( "ui.buttonset", {
version: "1.11.1",
version: "1.11.2",
options: {
items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
},

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Core 1.11.1
* jQuery UI Core 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -24,7 +24,7 @@
$.ui = $.ui || {};
$.extend( $.ui, {
version: "1.11.1",
version: "1.11.2",
keyCode: {
BACKSPACE: 8,

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Datepicker 1.11.1
* jQuery UI Datepicker 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -23,7 +23,7 @@
}
}(function( $ ) {
$.extend($.ui, { datepicker: { version: "1.11.1" } });
$.extend($.ui, { datepicker: { version: "1.11.2" } });
var datepicker_instActive;
@ -2073,7 +2073,7 @@ $.fn.datepicker = function(options){
$.datepicker = new Datepicker(); // singleton instance
$.datepicker.initialized = false;
$.datepicker.uuid = new Date().getTime();
$.datepicker.version = "1.11.1";
$.datepicker.version = "1.11.2";
return $.datepicker;

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Dialog 1.11.1
* jQuery UI Dialog 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -30,7 +30,7 @@
}(function( $ ) {
return $.widget( "ui.dialog", {
version: "1.11.1",
version: "1.11.2",
options: {
appendTo: "body",
autoOpen: true,

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Draggable 1.11.1
* jQuery UI Draggable 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -26,7 +26,7 @@
}(function( $ ) {
$.widget("ui.draggable", $.ui.mouse, {
version: "1.11.1",
version: "1.11.2",
widgetEventPrefix: "drag",
options: {
addClasses: true,
@ -61,8 +61,8 @@ $.widget("ui.draggable", $.ui.mouse, {
},
_create: function() {
if (this.options.helper === "original" && !(/^(?:r|a|f)/).test(this.element.css("position"))) {
this.element[0].style.position = "relative";
if ( this.options.helper === "original" ) {
this._setPositionRelative();
}
if (this.options.addClasses){
this.element.addClass("ui-draggable");
@ -94,20 +94,9 @@ $.widget("ui.draggable", $.ui.mouse, {
},
_mouseCapture: function(event) {
var o = this.options;
var document = this.document[ 0 ],
o = this.options;
// support: IE9
// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
try {
// Support: IE9+
// If the <body> is blurred, IE will switch windows, see #9520
if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) {
// Blur any element that currently has focus, see #4261
$( document.activeElement ).blur();
}
} catch ( error ) {}
this._blurActiveElement( event );
// among others, prevent a drag on a resizable-handle
if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
@ -120,20 +109,54 @@ $.widget("ui.draggable", $.ui.mouse, {
return false;
}
$(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
$("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>")
.css({
width: this.offsetWidth + "px", height: this.offsetHeight + "px",
position: "absolute", opacity: "0.001", zIndex: 1000
})
.css($(this).offset())
.appendTo("body");
});
this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix );
return true;
},
_blockFrames: function( selector ) {
this.iframeBlocks = this.document.find( selector ).map(function() {
var iframe = $( this );
return $( "<div>" )
.css( "position", "absolute" )
.appendTo( iframe.parent() )
.outerWidth( iframe.outerWidth() )
.outerHeight( iframe.outerHeight() )
.offset( iframe.offset() )[ 0 ];
});
},
_unblockFrames: function() {
if ( this.iframeBlocks ) {
this.iframeBlocks.remove();
delete this.iframeBlocks;
}
},
_blurActiveElement: function( event ) {
var document = this.document[ 0 ];
// Only need to blur if the event occurred on the draggable itself, see #10527
if ( !this.handleElement.is( event.target ) ) {
return;
}
// support: IE9
// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
try {
// Support: IE9, IE10
// If the <body> is blurred, IE will switch windows, see #9520
if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) {
// Blur any element that currently has focus, see #4261
$( document.activeElement ).blur();
}
} catch ( error ) {}
},
_mouseStart: function(event) {
var o = this.options;
@ -163,26 +186,13 @@ $.widget("ui.draggable", $.ui.mouse, {
this.cssPosition = this.helper.css( "position" );
this.scrollParent = this.helper.scrollParent( true );
this.offsetParent = this.helper.offsetParent();
this.offsetParentCssPosition = this.offsetParent.css( "position" );
this.hasFixedAncestor = this.helper.parents().filter(function() {
return $( this ).css( "position" ) === "fixed";
}).length > 0;
//The element's absolute position on the page minus margins
this.offset = this.positionAbs = this.element.offset();
this.offset = {
top: this.offset.top - this.margins.top,
left: this.offset.left - this.margins.left
};
//Reset scroll cache
this.offset.scroll = false;
$.extend(this.offset, {
click: { //Where the click happened, relative to the element
left: event.pageX - this.offset.left,
top: event.pageY - this.offset.top
},
parent: this._getParentOffset(),
relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
});
this.positionAbs = this.element.offset();
this._refreshOffsets( event );
//Generate the original position
this.originalPosition = this.position = this._generatePosition( event, false );
@ -209,6 +219,10 @@ $.widget("ui.draggable", $.ui.mouse, {
$.ui.ddmanager.prepareOffsets(this, event);
}
// Reset helper's right/bottom css if they're set and set explicit width/height instead
// as this prevents resizing of elements with right/bottom set (see #7772)
this._normalizeRightBottom();
this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
//If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
@ -219,9 +233,24 @@ $.widget("ui.draggable", $.ui.mouse, {
return true;
},
_refreshOffsets: function( event ) {
this.offset = {
top: this.positionAbs.top - this.margins.top,
left: this.positionAbs.left - this.margins.left,
scroll: false,
parent: this._getParentOffset(),
relative: this._getRelativeOffset()
};
this.offset.click = {
left: event.pageX - this.offset.left,
top: event.pageY - this.offset.top
};
},
_mouseDrag: function(event, noPropagation) {
// reset any necessary cached properties (see #5009)
if ( this.offsetParentCssPosition === "fixed" ) {
if ( this.hasFixedAncestor ) {
this.offset.parent = this._getParentOffset();
}
@ -279,19 +308,19 @@ $.widget("ui.draggable", $.ui.mouse, {
return false;
},
_mouseUp: function(event) {
//Remove frame helpers
$("div.ui-draggable-iframeFix").each(function() {
this.parentNode.removeChild(this);
});
_mouseUp: function( event ) {
this._unblockFrames();
//If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
if ( $.ui.ddmanager ) {
$.ui.ddmanager.dragStop(this, event);
}
// The interaction is over; whether or not the click resulted in a drag, focus the element
this.element.focus();
// Only need to focus if the event occurred on the draggable itself, see #10527
if ( this.handleElement.is( event.target ) ) {
// The interaction is over; whether or not the click resulted in a drag, focus the element
this.element.focus();
}
return $.ui.mouse.prototype._mouseUp.call(this, event);
},
@ -327,12 +356,24 @@ $.widget("ui.draggable", $.ui.mouse, {
_createHelper: function(event) {
var o = this.options,
helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[ 0 ], [ event ])) : (o.helper === "clone" ? this.element.clone().removeAttr("id") : this.element);
helperIsFunction = $.isFunction( o.helper ),
helper = helperIsFunction ?
$( o.helper.apply( this.element[ 0 ], [ event ] ) ) :
( o.helper === "clone" ?
this.element.clone().removeAttr( "id" ) :
this.element );
if (!helper.parents("body").length) {
helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));
}
// http://bugs.jqueryui.com/ticket/9446
// a helper function can return the original element
// which wouldn't have been set to relative in _create
if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) {
this._setPositionRelative();
}
if (helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) {
helper.css("position", "absolute");
}
@ -341,6 +382,12 @@ $.widget("ui.draggable", $.ui.mouse, {
},
_setPositionRelative: function() {
if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) {
this.element[ 0 ].style.position = "relative";
}
},
_adjustOffsetFromHelper: function(obj) {
if (typeof obj === "string") {
obj = obj.split(" ");
@ -425,7 +472,7 @@ $.widget("ui.draggable", $.ui.mouse, {
_setContainment: function() {
var over, c, ce,
var isUserScrollable, c, ce,
o = this.options,
document = this.document[ 0 ];
@ -472,13 +519,23 @@ $.widget("ui.draggable", $.ui.mouse, {
return;
}
over = c.css( "overflow" ) !== "hidden";
isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) );
this.containment = [
( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ),
( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) - ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) - this.helperProportions.width - this.margins.left - this.margins.right,
( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) - ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) - this.helperProportions.height - this.margins.top - this.margins.bottom
( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) -
( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) -
( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) -
this.helperProportions.width -
this.margins.left -
this.margins.right,
( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) -
( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) -
( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) -
this.helperProportions.height -
this.margins.top -
this.margins.bottom
];
this.relativeContainer = c;
},
@ -608,16 +665,29 @@ $.widget("ui.draggable", $.ui.mouse, {
}
},
_normalizeRightBottom: function() {
if ( this.options.axis !== "y" && this.helper.css( "right" ) !== "auto" ) {
this.helper.width( this.helper.width() );
this.helper.css( "right", "auto" );
}
if ( this.options.axis !== "x" && this.helper.css( "bottom" ) !== "auto" ) {
this.helper.height( this.helper.height() );
this.helper.css( "bottom", "auto" );
}
},
// From now on bulk stuff - mainly helpers
_trigger: function(type, event, ui) {
_trigger: function( type, event, ui ) {
ui = ui || this._uiHash();
$.ui.plugin.call( this, type, [ event, ui, this ], true );
//The absolute position has to be recalculated after plugins
if (type === "drag") {
this.positionAbs = this._convertPositionTo("absolute");
// Absolute position and offset (see #6884 ) have to be recalculated after plugins
if ( /^(drag|start|stop)/.test( type ) ) {
this.positionAbs = this._convertPositionTo( "absolute" );
ui.offset = this.positionAbs;
}
return $.Widget.prototype._trigger.call(this, type, event, ui);
return $.Widget.prototype._trigger.call( this, type, event, ui );
},
plugins: {},
@ -633,160 +703,197 @@ $.widget("ui.draggable", $.ui.mouse, {
});
$.ui.plugin.add("draggable", "connectToSortable", {
start: function( event, ui, inst ) {
$.ui.plugin.add( "draggable", "connectToSortable", {
start: function( event, ui, draggable ) {
var uiSortable = $.extend( {}, ui, {
item: draggable.element
});
var o = inst.options,
uiSortable = $.extend({}, ui, { item: inst.element });
inst.sortables = [];
$(o.connectToSortable).each(function() {
draggable.sortables = [];
$( draggable.options.connectToSortable ).each(function() {
var sortable = $( this ).sortable( "instance" );
if (sortable && !sortable.options.disabled) {
inst.sortables.push({
instance: sortable,
shouldRevert: sortable.options.revert
});
sortable.refreshPositions(); // Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page).
if ( sortable && !sortable.options.disabled ) {
draggable.sortables.push( sortable );
// refreshPositions is called at drag start to refresh the containerCache
// which is used in drag. This ensures it's initialized and synchronized
// with any changes that might have happened on the page since initialization.
sortable.refreshPositions();
sortable._trigger("activate", event, uiSortable);
}
});
},
stop: function( event, ui, inst ) {
//If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
stop: function( event, ui, draggable ) {
var uiSortable = $.extend( {}, ui, {
item: inst.element
item: draggable.element
});
$.each(inst.sortables, function() {
if (this.instance.isOver) {
draggable.cancelHelperRemoval = false;
this.instance.isOver = 0;
$.each( draggable.sortables, function() {
var sortable = this;
inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
if ( sortable.isOver ) {
sortable.isOver = 0;
//The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: "valid/invalid"
if (this.shouldRevert) {
this.instance.options.revert = this.shouldRevert;
}
// Allow this sortable to handle removing the helper
draggable.cancelHelperRemoval = true;
sortable.cancelHelperRemoval = false;
//Trigger the stop of the sortable
this.instance._mouseStop(event);
// Use _storedCSS To restore properties in the sortable,
// as this also handles revert (#9675) since the draggable
// may have modified them in unexpected ways (#8809)
sortable._storedCSS = {
position: sortable.placeholder.css( "position" ),
top: sortable.placeholder.css( "top" ),
left: sortable.placeholder.css( "left" )
};
this.instance.options.helper = this.instance.options._helper;
//If the helper has been the original item, restore properties in the sortable
if (inst.options.helper === "original") {
this.instance.currentItem.css({ top: "auto", left: "auto" });
}
sortable._mouseStop(event);
// Once drag has ended, the sortable should return to using
// its original helper, not the shared helper from draggable
sortable.options.helper = sortable.options._helper;
} else {
this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
this.instance._trigger("deactivate", event, uiSortable);
// Prevent this Sortable from removing the helper.
// However, don't set the draggable to remove the helper
// either as another connected Sortable may yet handle the removal.
sortable.cancelHelperRemoval = true;
sortable._trigger( "deactivate", event, uiSortable );
}
});
},
drag: function( event, ui, inst ) {
var that = this;
$.each(inst.sortables, function() {
drag: function( event, ui, draggable ) {
$.each( draggable.sortables, function() {
var innermostIntersecting = false,
thisSortable = this;
sortable = this;
//Copy over some variables to allow calling the sortable's native _intersectsWith
this.instance.positionAbs = inst.positionAbs;
this.instance.helperProportions = inst.helperProportions;
this.instance.offset.click = inst.offset.click;
// Copy over variables that sortable's _intersectsWith uses
sortable.positionAbs = draggable.positionAbs;
sortable.helperProportions = draggable.helperProportions;
sortable.offset.click = draggable.offset.click;
if (this.instance._intersectsWith(this.instance.containerCache)) {
if ( sortable._intersectsWith( sortable.containerCache ) ) {
innermostIntersecting = true;
$.each(inst.sortables, function() {
this.instance.positionAbs = inst.positionAbs;
this.instance.helperProportions = inst.helperProportions;
this.instance.offset.click = inst.offset.click;
if (this !== thisSortable &&
this.instance._intersectsWith(this.instance.containerCache) &&
$.contains(thisSortable.instance.element[0], this.instance.element[0])
) {
$.each( draggable.sortables, function() {
// Copy over variables that sortable's _intersectsWith uses
this.positionAbs = draggable.positionAbs;
this.helperProportions = draggable.helperProportions;
this.offset.click = draggable.offset.click;
if ( this !== sortable &&
this._intersectsWith( this.containerCache ) &&
$.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) {
innermostIntersecting = false;
}
return innermostIntersecting;
});
}
if (innermostIntersecting) {
//If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
if (!this.instance.isOver) {
if ( innermostIntersecting ) {
// If it intersects, we use a little isOver variable and set it once,
// so that the move-in stuff gets fired only once.
if ( !sortable.isOver ) {
sortable.isOver = 1;
this.instance.isOver = 1;
//Now we fake the start of dragging for the sortable instance,
//by cloning the list group item, appending it to the sortable and using it as inst.currentItem
//We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
this.instance.currentItem = $(that).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item", true);
this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
this.instance.options.helper = function() { return ui.helper[0]; };
sortable.currentItem = ui.helper
.appendTo( sortable.element )
.data( "ui-sortable-item", true );
event.target = this.instance.currentItem[0];
this.instance._mouseCapture(event, true);
this.instance._mouseStart(event, true, true);
// Store helper option to later restore it
sortable.options._helper = sortable.options.helper;
//Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
this.instance.offset.click.top = inst.offset.click.top;
this.instance.offset.click.left = inst.offset.click.left;
this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
sortable.options.helper = function() {
return ui.helper[ 0 ];
};
inst._trigger("toSortable", event);
inst.dropped = this.instance.element; //draggable revert needs that
//hack so receive/update callbacks work (mostly)
inst.currentItem = inst.element;
this.instance.fromOutside = inst;
// Fire the start events of the sortable with our passed browser event,
// and our own helper (so it doesn't create a new one)
event.target = sortable.currentItem[ 0 ];
sortable._mouseCapture( event, true );
sortable._mouseStart( event, true, true );
// Because the browser event is way off the new appended portlet,
// modify necessary variables to reflect the changes
sortable.offset.click.top = draggable.offset.click.top;
sortable.offset.click.left = draggable.offset.click.left;
sortable.offset.parent.left -= draggable.offset.parent.left -
sortable.offset.parent.left;
sortable.offset.parent.top -= draggable.offset.parent.top -
sortable.offset.parent.top;
draggable._trigger( "toSortable", event );
// Inform draggable that the helper is in a valid drop zone,
// used solely in the revert option to handle "valid/invalid".
draggable.dropped = sortable.element;
// Need to refreshPositions of all sortables in the case that
// adding to one sortable changes the location of the other sortables (#9675)
$.each( draggable.sortables, function() {
this.refreshPositions();
});
// hack so receive/update callbacks work (mostly)
draggable.currentItem = draggable.element;
sortable.fromOutside = draggable;
}
//Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
if (this.instance.currentItem) {
this.instance._mouseDrag(event);
if ( sortable.currentItem ) {
sortable._mouseDrag( event );
// Copy the sortable's position because the draggable's can potentially reflect
// a relative position, while sortable is always absolute, which the dragged
// element has now become. (#8809)
ui.position = sortable.position;
}
} else {
// If it doesn't intersect with the sortable, and it intersected before,
// we fake the drag stop of the sortable, but make sure it doesn't remove
// the helper by using cancelHelperRemoval.
if ( sortable.isOver ) {
//If it doesn't intersect with the sortable, and it intersected before,
//we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
if (this.instance.isOver) {
sortable.isOver = 0;
sortable.cancelHelperRemoval = true;
this.instance.isOver = 0;
this.instance.cancelHelperRemoval = true;
// Calling sortable's mouseStop would trigger a revert,
// so revert must be temporarily false until after mouseStop is called.
sortable.options._revert = sortable.options.revert;
sortable.options.revert = false;
//Prevent reverting on this forced stop
this.instance.options.revert = false;
sortable._trigger( "out", event, sortable._uiHash( sortable ) );
sortable._mouseStop( event, true );
// The out event needs to be triggered independently
this.instance._trigger("out", event, this.instance._uiHash(this.instance));
// restore sortable behaviors that were modfied
// when the draggable entered the sortable area (#9481)
sortable.options.revert = sortable.options._revert;
sortable.options.helper = sortable.options._helper;
this.instance._mouseStop(event, true);
this.instance.options.helper = this.instance.options._helper;
//Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
this.instance.currentItem.remove();
if (this.instance.placeholder) {
this.instance.placeholder.remove();
if ( sortable.placeholder ) {
sortable.placeholder.remove();
}
inst._trigger("fromSortable", event);
inst.dropped = false; //draggable revert needs that
// Recalculate the draggable's offset considering the sortable
// may have modified them in unexpected ways (#8809)
draggable._refreshOffsets( event );
ui.position = draggable._generatePosition( event, true );
draggable._trigger( "fromSortable", event );
// Inform draggable that the helper is no longer in a valid drop zone
draggable.dropped = false;
// Need to refreshPositions of all sortables just in case removing
// from one sortable changes the location of other sortables (#9675)
$.each( draggable.sortables, function() {
this.refreshPositions();
});
}
}
});
}
});
@ -916,9 +1023,9 @@ $.ui.plugin.add("draggable", "snap", {
for (i = inst.snapElements.length - 1; i >= 0; i--){
l = inst.snapElements[i].left;
l = inst.snapElements[i].left - inst.margins.left;
r = l + inst.snapElements[i].width;
t = inst.snapElements[i].top;
t = inst.snapElements[i].top - inst.margins.top;
b = t + inst.snapElements[i].height;
if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) {
@ -935,16 +1042,16 @@ $.ui.plugin.add("draggable", "snap", {
ls = Math.abs(l - x2) <= d;
rs = Math.abs(r - x1) <= d;
if (ts) {
ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top;
}
if (bs) {
ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top;
}
if (ls) {
ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left;
}
if (rs) {
ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left;
}
}
@ -956,16 +1063,16 @@ $.ui.plugin.add("draggable", "snap", {
ls = Math.abs(l - x1) <= d;
rs = Math.abs(r - x2) <= d;
if (ts) {
ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top;
}
if (bs) {
ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top;
}
if (ls) {
ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left;
}
if (rs) {
ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left;
}
}

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Droppable 1.11.1
* jQuery UI Droppable 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -27,7 +27,7 @@
}(function( $ ) {
$.widget( "ui.droppable", {
version: "1.11.1",
version: "1.11.2",
widgetEventPrefix: "drop",
options: {
accept: "*",
@ -235,8 +235,8 @@ $.ui.intersect = (function() {
return false;
}
var x1 = ( draggable.positionAbs || draggable.position.absolute ).left,
y1 = ( draggable.positionAbs || draggable.position.absolute ).top,
var x1 = ( draggable.positionAbs || draggable.position.absolute ).left + draggable.margins.left,
y1 = ( draggable.positionAbs || draggable.position.absolute ).top + draggable.margins.top,
x2 = x1 + draggable.helperProportions.width,
y2 = y1 + draggable.helperProportions.height,
l = droppable.offset.left,

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Effects Blind 1.11.1
* jQuery UI Effects Blind 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Effects Bounce 1.11.1
* jQuery UI Effects Bounce 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Effects Clip 1.11.1
* jQuery UI Effects Clip 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Effects Drop 1.11.1
* jQuery UI Effects Drop 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -42,7 +42,7 @@ return $.effects.effect.drop = function( o, done ) {
el.show();
$.effects.createWrapper( el );
distance = o.distance || el[ ref === "top" ? "outerHeight": "outerWidth" ]( true ) / 2;
distance = o.distance || el[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2;
if ( show ) {
el

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Effects Explode 1.11.1
* jQuery UI Effects Explode 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Effects Fade 1.11.1
* jQuery UI Effects Fade 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Effects Fold 1.11.1
* jQuery UI Effects Fold 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Effects Highlight 1.11.1
* jQuery UI Effects Highlight 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Effects Puff 1.11.1
* jQuery UI Effects Puff 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Effects Pulsate 1.11.1
* jQuery UI Effects Pulsate 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Effects Scale 1.11.1
* jQuery UI Effects Scale 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Effects Shake 1.11.1
* jQuery UI Effects Shake 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Effects Size 1.11.1
* jQuery UI Effects Size 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Effects Slide 1.11.1
* jQuery UI Effects Slide 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Effects Transfer 1.11.1
* jQuery UI Effects Transfer 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Effects 1.11.1
* jQuery UI Effects 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -633,7 +633,7 @@ color.hook = function( hook ) {
}
try {
elem.style[ hook ] = value;
} catch( e ) {
} catch ( e ) {
// wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit'
}
}
@ -904,7 +904,7 @@ $.fn.extend({
(function() {
$.extend( $.effects, {
version: "1.11.1",
version: "1.11.2",
// Saves a set of properties in a data storage
save: function( element, set ) {
@ -998,7 +998,7 @@ $.extend( $.effects, {
// https://bugzilla.mozilla.org/show_bug.cgi?id=561664
try {
active.id;
} catch( e ) {
} catch ( e ) {
active = document.body;
}

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Menu 1.11.1
* jQuery UI Menu 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -26,7 +26,7 @@
}(function( $ ) {
return $.widget( "ui.menu", {
version: "1.11.1",
version: "1.11.2",
defaultElement: "<ul>",
delay: 300,
options: {
@ -101,6 +101,12 @@ return $.widget( "ui.menu", {
}
},
"mouseenter .ui-menu-item": function( event ) {
// Ignore mouse events while typeahead is active, see #10458.
// Prevents focusing the wrong item when typeahead causes a scroll while the mouse
// is over an item in the menu
if ( this.previousFilter ) {
return;
}
var target = $( event.currentTarget );
// Remove ui-state-active class from siblings of the newly focused menu item
// to avoid a jump caused by adjacent elements both having a class with a border
@ -180,13 +186,9 @@ return $.widget( "ui.menu", {
},
_keydown: function( event ) {
var match, prev, character, skip, regex,
var match, prev, character, skip,
preventDefault = true;
function escape( value ) {
return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" );
}
switch ( event.keyCode ) {
case $.ui.keyCode.PAGE_UP:
this.previousPage( event );
@ -235,10 +237,7 @@ return $.widget( "ui.menu", {
character = prev + character;
}
regex = new RegExp( "^" + escape( character ), "i" );
match = this.activeMenu.find( this.options.items ).filter(function() {
return regex.test( $( this ).text() );
});
match = this._filterMenuItems( character );
match = skip && match.index( this.active.next() ) !== -1 ?
this.active.nextAll( ".ui-menu-item" ) :
match;
@ -247,22 +246,15 @@ return $.widget( "ui.menu", {
// to move down the menu to the first item that starts with that character
if ( !match.length ) {
character = String.fromCharCode( event.keyCode );
regex = new RegExp( "^" + escape( character ), "i" );
match = this.activeMenu.find( this.options.items ).filter(function() {
return regex.test( $( this ).text() );
});
match = this._filterMenuItems( character );
}
if ( match.length ) {
this.focus( event, match );
if ( match.length > 1 ) {
this.previousFilter = character;
this.filterTimer = this._delay(function() {
delete this.previousFilter;
}, 1000 );
} else {
this.previousFilter = character;
this.filterTimer = this._delay(function() {
delete this.previousFilter;
}
}, 1000 );
} else {
delete this.previousFilter;
}
@ -634,6 +626,20 @@ return $.widget( "ui.menu", {
this.collapseAll( event, true );
}
this._trigger( "select", event, ui );
},
_filterMenuItems: function(character) {
var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ),
regex = new RegExp( "^" + escapedCharacter, "i" );
return this.activeMenu
.find( this.options.items )
// Only match on items, not dividers or other content (#10571)
.filter( ".ui-menu-item" )
.filter(function() {
return regex.test( $.trim( $( this ).text() ) );
});
}
});

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Mouse 1.11.1
* jQuery UI Mouse 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -29,7 +29,7 @@ $( document ).mouseup( function() {
});
return $.widget("ui.mouse", {
version: "1.11.1",
version: "1.11.2",
options: {
cancel: "input,textarea,button,select,option",
distance: 1,
@ -70,6 +70,8 @@ return $.widget("ui.mouse", {
return;
}
this._mouseMoved = false;
// we may have missed mouseup (out of window)
(this._mouseStarted && this._mouseUp(event));
@ -123,13 +125,23 @@ return $.widget("ui.mouse", {
},
_mouseMove: function(event) {
// IE mouseup check - mouseup happened when mouse was out of window
if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) {
return this._mouseUp(event);
// Only check for mouseups outside the document if you've moved inside the document
// at least once. This prevents the firing of mouseup in the case of IE<9, which will
// fire a mousemove event if content is placed under the cursor. See #7778
// Support: IE <9
if ( this._mouseMoved ) {
// IE mouseup check - mouseup happened when mouse was out of window
if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) {
return this._mouseUp(event);
// Iframe mouseup check - mouseup occurred in another document
} else if ( !event.which ) {
return this._mouseUp( event );
// Iframe mouseup check - mouseup occurred in another document
} else if ( !event.which ) {
return this._mouseUp( event );
}
}
if ( event.which || event.button ) {
this._mouseMoved = true;
}
if (this._mouseStarted) {

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Position 1.11.1
* jQuery UI Position 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Progressbar 1.11.1
* jQuery UI Progressbar 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -25,7 +25,7 @@
}(function( $ ) {
return $.widget( "ui.progressbar", {
version: "1.11.1",
version: "1.11.2",
options: {
max: 100,
value: 0,

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Resizable 1.11.1
* jQuery UI Resizable 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -26,7 +26,7 @@
}(function( $ ) {
$.widget("ui.resizable", $.ui.mouse, {
version: "1.11.1",
version: "1.11.2",
widgetEventPrefix: "resize",
options: {
alsoResize: false,

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Selectable 1.11.1
* jQuery UI Selectable 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -26,7 +26,7 @@
}(function( $ ) {
return $.widget("ui.selectable", $.ui.mouse, {
version: "1.11.1",
version: "1.11.2",
options: {
appendTo: "body",
autoRefresh: true,

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Selectmenu 1.11.1
* jQuery UI Selectmenu 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -27,7 +27,7 @@
}(function( $ ) {
return $.widget( "ui.selectmenu", {
version: "1.11.1",
version: "1.11.2",
defaultElement: "<select>",
options: {
appendTo: null,
@ -144,6 +144,12 @@ return $.widget( "ui.selectmenu", {
role: "listbox",
select: function( event, ui ) {
event.preventDefault();
// support: IE8
// If the item was selected via a click, the text selection
// will be destroyed in IE
that._setSelection();
that._select( ui.item.data( "ui-selectmenu-item" ), event );
},
focus: function( event, ui ) {
@ -254,6 +260,7 @@ return $.widget( "ui.selectmenu", {
this.isOpen = false;
this._toggleAttr();
this.range = null;
this._off( this.document );
this._trigger( "close", event );
@ -342,6 +349,29 @@ return $.widget( "ui.selectmenu", {
this[ this.isOpen ? "close" : "open" ]( event );
},
_setSelection: function() {
var selection;
if ( !this.range ) {
return;
}
if ( window.getSelection ) {
selection = window.getSelection();
selection.removeAllRanges();
selection.addRange( this.range );
// support: IE8
} else {
this.range.select();
}
// support: IE
// Setting the text selection kills the button focus in IE, but
// restoring the focus doesn't kill the selection.
this.button.focus();
},
_documentClick: {
mousedown: function( event ) {
if ( !this.isOpen ) {
@ -357,11 +387,25 @@ return $.widget( "ui.selectmenu", {
_buttonEvents: {
// Prevent text selection from being reset when interacting with the selectmenu (#10144)
mousedown: function( event ) {
event.preventDefault();
mousedown: function() {
var selection;
if ( window.getSelection ) {
selection = window.getSelection();
if ( selection.rangeCount ) {
this.range = selection.getRangeAt( 0 );
}
// support: IE8
} else {
this.range = document.selection.createRange();
}
},
click: "_toggle",
click: function( event ) {
this._setSelection();
this._toggle( event );
},
keydown: function( event ) {
var preventDefault = true;

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Slider 1.11.1
* jQuery UI Slider 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -26,7 +26,7 @@
}(function( $ ) {
return $.widget( "ui.slider", $.ui.mouse, {
version: "1.11.1",
version: "1.11.2",
widgetEventPrefix: "slide",
options: {
@ -58,6 +58,7 @@ return $.widget( "ui.slider", $.ui.mouse, {
this._handleIndex = null;
this._detectOrientation();
this._mouseInit();
this._calculateNewMax();
this.element
.addClass( "ui-slider" +
@ -472,9 +473,11 @@ return $.widget( "ui.slider", $.ui.mouse, {
}
this._animateOff = false;
break;
case "step":
case "min":
case "max":
this._animateOff = true;
this._calculateNewMax();
this._refreshValue();
this._animateOff = false;
break;
@ -512,7 +515,7 @@ return $.widget( "ui.slider", $.ui.mouse, {
// .slice() creates a copy of the array
// this copy gets trimmed by min and max and then returned
vals = this.options.values.slice();
for ( i = 0; i < vals.length; i+= 1) {
for ( i = 0; i < vals.length; i += 1) {
vals[ i ] = this._trimAlignValue( vals[ i ] );
}
@ -543,12 +546,17 @@ return $.widget( "ui.slider", $.ui.mouse, {
return parseFloat( alignValue.toFixed(5) );
},
_calculateNewMax: function() {
var remainder = ( this.options.max - this._valueMin() ) % this.options.step;
this.max = this.options.max - remainder;
},
_valueMin: function() {
return this.options.min;
},
_valueMax: function() {
return this.options.max;
return this.max;
},
_refreshValue: function() {

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Sortable 1.11.1
* jQuery UI Sortable 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -26,7 +26,7 @@
}(function( $ ) {
return $.widget("ui.sortable", $.ui.mouse, {
version: "1.11.1",
version: "1.11.2",
widgetEventPrefix: "sort",
ready: false,
options: {
@ -911,6 +911,10 @@ return $.widget("ui.sortable", $.ui.mouse, {
}
if(this.currentContainer === this.containers[innermostIndex]) {
if ( !this.currentContainer.containerCache.over ) {
this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() );
this.currentContainer.containerCache.over = 1;
}
return;
}
@ -1249,18 +1253,6 @@ return $.widget("ui.sortable", $.ui.mouse, {
}
this.dragging = false;
if(this.cancelHelperRemoval) {
if(!noPropagation) {
this._trigger("beforeStop", event, this._uiHash());
for (i=0; i < delayedTriggers.length; i++) {
delayedTriggers[i].call(this, event);
} //Trigger all delayed events
this._trigger("stop", event, this._uiHash());
}
this.fromOutside = false;
return false;
}
if(!noPropagation) {
this._trigger("beforeStop", event, this._uiHash());
@ -1269,10 +1261,12 @@ return $.widget("ui.sortable", $.ui.mouse, {
//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
if(this.helper[0] !== this.currentItem[0]) {
this.helper.remove();
if ( !this.cancelHelperRemoval ) {
if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) {
this.helper.remove();
}
this.helper = null;
}
this.helper = null;
if(!noPropagation) {
for (i=0; i < delayedTriggers.length; i++) {
@ -1282,7 +1276,7 @@ return $.widget("ui.sortable", $.ui.mouse, {
}
this.fromOutside = false;
return true;
return !this.cancelHelperRemoval;
},

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Spinner 1.11.1
* jQuery UI Spinner 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -37,7 +37,7 @@ function spinner_modifier( fn ) {
}
return $.widget( "ui.spinner", {
version: "1.11.1",
version: "1.11.2",
defaultElement: "<input>",
widgetEventPrefix: "spin",
options: {

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Tabs 1.11.1
* jQuery UI Tabs 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -25,7 +25,7 @@
}(function( $ ) {
return $.widget( "ui.tabs", {
version: "1.11.1",
version: "1.11.2",
delay: 300,
options: {
active: null,
@ -372,7 +372,10 @@ return $.widget( "ui.tabs", {
},
_processTabs: function() {
var that = this;
var that = this,
prevTabs = this.tabs,
prevAnchors = this.anchors,
prevPanels = this.panels;
this.tablist = this._getList()
.addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
@ -456,6 +459,13 @@ return $.widget( "ui.tabs", {
this.panels
.addClass( "ui-tabs-panel ui-widget-content ui-corner-bottom" )
.attr( "role", "tabpanel" );
// Avoid memory leaks (#10056)
if ( prevTabs ) {
this._off( prevTabs.not( this.tabs ) );
this._off( prevAnchors.not( this.anchors ) );
this._off( prevPanels.not( this.panels ) );
}
},
// allow overriding how to find the list for rare usage scenarios (#7715)

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Tooltip 1.11.1
* jQuery UI Tooltip 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -26,7 +26,7 @@
}(function( $ ) {
return $.widget( "ui.tooltip", {
version: "1.11.1",
version: "1.11.2",
options: {
content: function() {
// support: IE<9, Opera in jQuery <1.7
@ -86,6 +86,7 @@ return $.widget( "ui.tooltip", {
// IDs of generated tooltips, needed for destroy
this.tooltips = {};
// IDs of parent tooltips where we removed the title attribute
this.parents = {};
@ -117,8 +118,8 @@ return $.widget( "ui.tooltip", {
this._super( key, value );
if ( key === "content" ) {
$.each( this.tooltips, function( id, element ) {
that._updateContent( element );
$.each( this.tooltips, function( id, tooltipData ) {
that._updateContent( tooltipData.element );
});
}
},
@ -127,9 +128,9 @@ return $.widget( "ui.tooltip", {
var that = this;
// close open tooltips
$.each( this.tooltips, function( id, element ) {
$.each( this.tooltips, function( id, tooltipData ) {
var event = $.Event( "blur" );
event.target = event.currentTarget = element[0];
event.target = event.currentTarget = tooltipData.element[ 0 ];
that.close( event, true );
});
@ -231,7 +232,7 @@ return $.widget( "ui.tooltip", {
},
_open: function( event, target, content ) {
var tooltip, events, delayedShow, a11yContent,
var tooltipData, tooltip, events, delayedShow, a11yContent,
positionOption = $.extend( {}, this.options.position );
if ( !content ) {
@ -240,9 +241,9 @@ return $.widget( "ui.tooltip", {
// Content can be updated multiple times. If the tooltip already
// exists, then just update the content and bail.
tooltip = this._find( target );
if ( tooltip.length ) {
tooltip.find( ".ui-tooltip-content" ).html( content );
tooltipData = this._find( target );
if ( tooltipData ) {
tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content );
return;
}
@ -261,7 +262,8 @@ return $.widget( "ui.tooltip", {
}
}
tooltip = this._tooltip( target );
tooltipData = this._tooltip( target );
tooltip = tooltipData.tooltip;
this._addDescribedBy( target, tooltip.attr( "id" ) );
tooltip.find( ".ui-tooltip-content" ).html( content );
@ -296,8 +298,6 @@ return $.widget( "ui.tooltip", {
}, this.options.position ) );
}
this.hiding = false;
this.closing = false;
tooltip.hide();
this._show( tooltip, this.options.show );
@ -343,13 +343,21 @@ return $.widget( "ui.tooltip", {
},
close: function( event ) {
var that = this,
var tooltip,
that = this,
target = $( event ? event.currentTarget : this.element ),
tooltip = this._find( target );
tooltipData = this._find( target );
// The tooltip may already be closed
if ( !tooltipData ) {
return;
}
tooltip = tooltipData.tooltip;
// disabling closes the tooltip, so we need to track when we're closing
// to avoid an infinite loop in case the tooltip becomes disabled on close
if ( this.closing ) {
if ( tooltipData.closing ) {
return;
}
@ -364,12 +372,10 @@ return $.widget( "ui.tooltip", {
this._removeDescribedBy( target );
this.hiding = true;
tooltipData.hiding = true;
tooltip.stop( true );
this._hide( tooltip, this.options.hide, function() {
that._removeTooltip( $( this ) );
this.hiding = false;
this.closing = false;
});
target.removeData( "ui-tooltip-open" );
@ -388,10 +394,10 @@ return $.widget( "ui.tooltip", {
});
}
this.closing = true;
tooltipData.closing = true;
this._trigger( "close", event, { tooltip: tooltip } );
if ( !this.hiding ) {
this.closing = false;
if ( !tooltipData.hiding ) {
tooltipData.closing = false;
}
},
@ -407,13 +413,16 @@ return $.widget( "ui.tooltip", {
.appendTo( tooltip );
tooltip.appendTo( this.document[0].body );
this.tooltips[ id ] = element;
return tooltip;
return this.tooltips[ id ] = {
element: element,
tooltip: tooltip
};
},
_find: function( target ) {
var id = target.data( "ui-tooltip-id" );
return id ? $( "#" + id ) : $();
return id ? this.tooltips[ id ] : null;
},
_removeTooltip: function( tooltip ) {
@ -425,10 +434,11 @@ return $.widget( "ui.tooltip", {
var that = this;
// close open tooltips
$.each( this.tooltips, function( id, element ) {
$.each( this.tooltips, function( id, tooltipData ) {
// Delegate to close method to handle common cleanup
var event = $.Event( "blur" );
event.target = event.currentTarget = element[0];
var event = $.Event( "blur" ),
element = tooltipData.element;
event.target = event.currentTarget = element[ 0 ];
that.close( event, true );
// Remove immediately; destroying an open tooltip doesn't use the

View File

@ -1,5 +1,5 @@
/*!
* jQuery UI Widget 1.11.1
* jQuery UI Widget 1.11.2
* http://jqueryui.com
*
* Copyright 2014 jQuery Foundation and other contributors
@ -36,7 +36,7 @@ $.cleanData = (function( orig ) {
}
// http://bugs.jquery.com/ticket/8235
} catch( e ) {}
} catch ( e ) {}
}
orig( elems );
};
@ -254,10 +254,6 @@ $.Widget.prototype = {
this.element = $( element );
this.uuid = widget_uuid++;
this.eventNamespace = "." + this.widgetName + this.uuid;
this.options = $.widget.extend( {},
this.options,
this._getCreateOptions(),
options );
this.bindings = $();
this.hoverable = $();
@ -280,6 +276,11 @@ $.Widget.prototype = {
this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
}
this.options = $.widget.extend( {},
this.options,
this._getCreateOptions(),
options );
this._create();
this._trigger( "create", null, this._getCreateEventData() );
this._init();
@ -442,8 +443,14 @@ $.Widget.prototype = {
},
_off: function( element, eventName ) {
eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;
eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) +
this.eventNamespace;
element.unbind( eventName ).undelegate( eventName );
// Clear the stack to avoid memory leaks (#10056)
this.bindings = $( this.bindings.not( element ).get() );
this.focusable = $( this.focusable.not( element ).get() );
this.hoverable = $( this.hoverable.not( element ).get() );
},
_delay: function( handler, delay ) {

View File

@ -165,45 +165,45 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '1.2.1' );
// full jQuery UI
$scripts->add( 'jquery-ui-core', "/wp-includes/js/jquery/ui/core$dev_suffix.js", array('jquery'), '1.11.1', 1 );
$scripts->add( 'jquery-effects-core', "/wp-includes/js/jquery/ui/effect$dev_suffix.js", array('jquery'), '1.11.1', 1 );
$scripts->add( 'jquery-ui-core', "/wp-includes/js/jquery/ui/core$dev_suffix.js", array('jquery'), '1.11.2', 1 );
$scripts->add( 'jquery-effects-core', "/wp-includes/js/jquery/ui/effect$dev_suffix.js", array('jquery'), '1.11.2', 1 );
$scripts->add( 'jquery-effects-blind', "/wp-includes/js/jquery/ui/effect-blind$dev_suffix.js", array('jquery-effects-core'), '1.11.1', 1 );
$scripts->add( 'jquery-effects-bounce', "/wp-includes/js/jquery/ui/effect-bounce$dev_suffix.js", array('jquery-effects-core'), '1.11.1', 1 );
$scripts->add( 'jquery-effects-clip', "/wp-includes/js/jquery/ui/effect-clip$dev_suffix.js", array('jquery-effects-core'), '1.11.1', 1 );
$scripts->add( 'jquery-effects-drop', "/wp-includes/js/jquery/ui/effect-drop$dev_suffix.js", array('jquery-effects-core'), '1.11.1', 1 );
$scripts->add( 'jquery-effects-explode', "/wp-includes/js/jquery/ui/effect-explode$dev_suffix.js", array('jquery-effects-core'), '1.11.1', 1 );
$scripts->add( 'jquery-effects-fade', "/wp-includes/js/jquery/ui/effect-fade$dev_suffix.js", array('jquery-effects-core'), '1.11.1', 1 );
$scripts->add( 'jquery-effects-fold', "/wp-includes/js/jquery/ui/effect-fold$dev_suffix.js", array('jquery-effects-core'), '1.11.1', 1 );
$scripts->add( 'jquery-effects-highlight', "/wp-includes/js/jquery/ui/effect-highlight$dev_suffix.js", array('jquery-effects-core'), '1.11.1', 1 );
$scripts->add( 'jquery-effects-puff', "/wp-includes/js/jquery/ui/effect-puff$dev_suffix.js", array('jquery-effects-core'), '1.11.1', 1 );
$scripts->add( 'jquery-effects-pulsate', "/wp-includes/js/jquery/ui/effect-pulsate$dev_suffix.js", array('jquery-effects-core'), '1.11.1', 1 );
$scripts->add( 'jquery-effects-scale', "/wp-includes/js/jquery/ui/effect-scale$dev_suffix.js", array('jquery-effects-core'), '1.11.1', 1 );
$scripts->add( 'jquery-effects-shake', "/wp-includes/js/jquery/ui/effect-shake$dev_suffix.js", array('jquery-effects-core'), '1.11.1', 1 );
$scripts->add( 'jquery-effects-size', "/wp-includes/js/jquery/ui/effect-size$dev_suffix.js", array('jquery-effects-core'), '1.11.1', 1 );
$scripts->add( 'jquery-effects-slide', "/wp-includes/js/jquery/ui/effect-slide$dev_suffix.js", array('jquery-effects-core'), '1.11.1', 1 );
$scripts->add( 'jquery-effects-transfer', "/wp-includes/js/jquery/ui/effect-transfer$dev_suffix.js", array('jquery-effects-core'), '1.11.1', 1 );
$scripts->add( 'jquery-effects-blind', "/wp-includes/js/jquery/ui/effect-blind$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 );
$scripts->add( 'jquery-effects-bounce', "/wp-includes/js/jquery/ui/effect-bounce$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 );
$scripts->add( 'jquery-effects-clip', "/wp-includes/js/jquery/ui/effect-clip$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 );
$scripts->add( 'jquery-effects-drop', "/wp-includes/js/jquery/ui/effect-drop$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 );
$scripts->add( 'jquery-effects-explode', "/wp-includes/js/jquery/ui/effect-explode$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 );
$scripts->add( 'jquery-effects-fade', "/wp-includes/js/jquery/ui/effect-fade$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 );
$scripts->add( 'jquery-effects-fold', "/wp-includes/js/jquery/ui/effect-fold$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 );
$scripts->add( 'jquery-effects-highlight', "/wp-includes/js/jquery/ui/effect-highlight$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 );
$scripts->add( 'jquery-effects-puff', "/wp-includes/js/jquery/ui/effect-puff$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 );
$scripts->add( 'jquery-effects-pulsate', "/wp-includes/js/jquery/ui/effect-pulsate$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 );
$scripts->add( 'jquery-effects-scale', "/wp-includes/js/jquery/ui/effect-scale$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 );
$scripts->add( 'jquery-effects-shake', "/wp-includes/js/jquery/ui/effect-shake$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 );
$scripts->add( 'jquery-effects-size', "/wp-includes/js/jquery/ui/effect-size$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 );
$scripts->add( 'jquery-effects-slide', "/wp-includes/js/jquery/ui/effect-slide$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 );
$scripts->add( 'jquery-effects-transfer', "/wp-includes/js/jquery/ui/effect-transfer$dev_suffix.js", array('jquery-effects-core'), '1.11.2', 1 );
$scripts->add( 'jquery-ui-accordion', "/wp-includes/js/jquery/ui/accordion$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.1', 1 );
$scripts->add( 'jquery-ui-autocomplete', "/wp-includes/js/jquery/ui/autocomplete$dev_suffix.js", array('jquery-ui-menu'), '1.11.1', 1 );
$scripts->add( 'jquery-ui-button', "/wp-includes/js/jquery/ui/button$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.1', 1 );
$scripts->add( 'jquery-ui-datepicker', "/wp-includes/js/jquery/ui/datepicker$dev_suffix.js", array('jquery-ui-core'), '1.11.1', 1 );
$scripts->add( 'jquery-ui-dialog', "/wp-includes/js/jquery/ui/dialog$dev_suffix.js", array('jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-button', 'jquery-ui-position'), '1.11.1', 1 );
$scripts->add( 'jquery-ui-draggable', "/wp-includes/js/jquery/ui/draggable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.1', 1 );
$scripts->add( 'jquery-ui-droppable', "/wp-includes/js/jquery/ui/droppable$dev_suffix.js", array('jquery-ui-draggable'), '1.11.1', 1 );
$scripts->add( 'jquery-ui-menu', "/wp-includes/js/jquery/ui/menu$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.11.1', 1 );
$scripts->add( 'jquery-ui-mouse', "/wp-includes/js/jquery/ui/mouse$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget' ), '1.11.1', 1 );
$scripts->add( 'jquery-ui-position', "/wp-includes/js/jquery/ui/position$dev_suffix.js", array('jquery'), '1.11.1', 1 );
$scripts->add( 'jquery-ui-progressbar', "/wp-includes/js/jquery/ui/progressbar$dev_suffix.js", array('jquery-ui-widget'), '1.11.1', 1 );
$scripts->add( 'jquery-ui-resizable', "/wp-includes/js/jquery/ui/resizable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.1', 1 );
$scripts->add( 'jquery-ui-selectable', "/wp-includes/js/jquery/ui/selectable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.1', 1 );
$scripts->add( 'jquery-ui-selectmenu', "/wp-includes/js/jquery/ui/selectmenu$dev_suffix.js", array('jquery-ui-menu'), '1.11.1', 1 );
$scripts->add( 'jquery-ui-slider', "/wp-includes/js/jquery/ui/slider$dev_suffix.js", array('jquery-ui-mouse'), '1.11.1', 1 );
$scripts->add( 'jquery-ui-sortable', "/wp-includes/js/jquery/ui/sortable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.1', 1 );
$scripts->add( 'jquery-ui-spinner', "/wp-includes/js/jquery/ui/spinner$dev_suffix.js", array( 'jquery-ui-button' ), '1.11.1', 1 );
$scripts->add( 'jquery-ui-tabs', "/wp-includes/js/jquery/ui/tabs$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.1', 1 );
$scripts->add( 'jquery-ui-tooltip', "/wp-includes/js/jquery/ui/tooltip$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.11.1', 1 );
$scripts->add( 'jquery-ui-widget', "/wp-includes/js/jquery/ui/widget$dev_suffix.js", array('jquery'), '1.11.1', 1 );
$scripts->add( 'jquery-ui-accordion', "/wp-includes/js/jquery/ui/accordion$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.2', 1 );
$scripts->add( 'jquery-ui-autocomplete', "/wp-includes/js/jquery/ui/autocomplete$dev_suffix.js", array('jquery-ui-menu'), '1.11.2', 1 );
$scripts->add( 'jquery-ui-button', "/wp-includes/js/jquery/ui/button$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.2', 1 );
$scripts->add( 'jquery-ui-datepicker', "/wp-includes/js/jquery/ui/datepicker$dev_suffix.js", array('jquery-ui-core'), '1.11.2', 1 );
$scripts->add( 'jquery-ui-dialog', "/wp-includes/js/jquery/ui/dialog$dev_suffix.js", array('jquery-ui-resizable', 'jquery-ui-draggable', 'jquery-ui-button', 'jquery-ui-position'), '1.11.2', 1 );
$scripts->add( 'jquery-ui-draggable', "/wp-includes/js/jquery/ui/draggable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.2', 1 );
$scripts->add( 'jquery-ui-droppable', "/wp-includes/js/jquery/ui/droppable$dev_suffix.js", array('jquery-ui-draggable'), '1.11.2', 1 );
$scripts->add( 'jquery-ui-menu', "/wp-includes/js/jquery/ui/menu$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.11.2', 1 );
$scripts->add( 'jquery-ui-mouse', "/wp-includes/js/jquery/ui/mouse$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget' ), '1.11.2', 1 );
$scripts->add( 'jquery-ui-position', "/wp-includes/js/jquery/ui/position$dev_suffix.js", array('jquery'), '1.11.2', 1 );
$scripts->add( 'jquery-ui-progressbar', "/wp-includes/js/jquery/ui/progressbar$dev_suffix.js", array('jquery-ui-widget'), '1.11.2', 1 );
$scripts->add( 'jquery-ui-resizable', "/wp-includes/js/jquery/ui/resizable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.2', 1 );
$scripts->add( 'jquery-ui-selectable', "/wp-includes/js/jquery/ui/selectable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.2', 1 );
$scripts->add( 'jquery-ui-selectmenu', "/wp-includes/js/jquery/ui/selectmenu$dev_suffix.js", array('jquery-ui-menu'), '1.11.2', 1 );
$scripts->add( 'jquery-ui-slider', "/wp-includes/js/jquery/ui/slider$dev_suffix.js", array('jquery-ui-mouse'), '1.11.2', 1 );
$scripts->add( 'jquery-ui-sortable', "/wp-includes/js/jquery/ui/sortable$dev_suffix.js", array('jquery-ui-mouse'), '1.11.2', 1 );
$scripts->add( 'jquery-ui-spinner', "/wp-includes/js/jquery/ui/spinner$dev_suffix.js", array( 'jquery-ui-button' ), '1.11.2', 1 );
$scripts->add( 'jquery-ui-tabs', "/wp-includes/js/jquery/ui/tabs$dev_suffix.js", array('jquery-ui-core', 'jquery-ui-widget'), '1.11.2', 1 );
$scripts->add( 'jquery-ui-tooltip', "/wp-includes/js/jquery/ui/tooltip$dev_suffix.js", array( 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-position' ), '1.11.2', 1 );
$scripts->add( 'jquery-ui-widget', "/wp-includes/js/jquery/ui/widget$dev_suffix.js", array('jquery'), '1.11.2', 1 );
// deprecated, not used in core, most functionality is included in jQuery 1.3
$scripts->add( 'jquery-form', "/wp-includes/js/jquery/jquery.form$suffix.js", array('jquery'), '3.37.0', 1 );