[TASK] Update jQuery UI to 1.11.4 48/39548/2
authorWouter Wolters <typo3@wouterwolters.nl>
Thu, 14 May 2015 15:41:24 +0000 (17:41 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Thu, 14 May 2015 22:54:20 +0000 (00:54 +0200)
Resolves: #66960
Releases: master
Change-Id: Ic18dc244f0a2ea0f50de91b2a75e85c26dd082a1
Reviewed-on: http://review.typo3.org/39548
Reviewed-by: Benjamin Kott <info@bk2k.info>
Tested-by: Benjamin Kott <info@bk2k.info>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Build/bower.json
typo3/sysext/core/Resources/Public/JavaScript/Contrib/jquery-ui/core.js
typo3/sysext/core/Resources/Public/JavaScript/Contrib/jquery-ui/draggable.js
typo3/sysext/core/Resources/Public/JavaScript/Contrib/jquery-ui/droppable.js
typo3/sysext/core/Resources/Public/JavaScript/Contrib/jquery-ui/mouse.js
typo3/sysext/core/Resources/Public/JavaScript/Contrib/jquery-ui/position.js
typo3/sysext/core/Resources/Public/JavaScript/Contrib/jquery-ui/resizable.js
typo3/sysext/core/Resources/Public/JavaScript/Contrib/jquery-ui/selectable.js
typo3/sysext/core/Resources/Public/JavaScript/Contrib/jquery-ui/sortable.js
typo3/sysext/core/Resources/Public/JavaScript/Contrib/jquery-ui/widget.js

index 237b73e..e7ea0ed 100644 (file)
@@ -29,7 +29,7 @@
   "dependencies": {
     "scriptaculous-bower": "1.9.0",
     "requirejs": "2.1.15",
-    "jquery-ui": "1.11.2",
+    "jquery-ui": "1.11.4",
     "eonasdan-bootstrap-datetimepicker": "4.7.14",
     "moment": "2.10.2",
     "nprogress": "0.2.0",
index d14b737..4697128 100644 (file)
@@ -1,8 +1,8 @@
 /*!
- * jQuery UI Core 1.11.2
+ * jQuery UI Core 1.11.4
  * http://jqueryui.com
  *
- * Copyright 2014 jQuery Foundation and other contributors
+ * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  *
@@ -24,7 +24,7 @@
 $.ui = $.ui || {};
 
 $.extend( $.ui, {
-       version: "1.11.2",
+       version: "1.11.4",
 
        keyCode: {
                BACKSPACE: 8,
@@ -97,7 +97,7 @@ function focusable( element, isTabIndexNotNaN ) {
                img = $( "img[usemap='#" + mapName + "']" )[ 0 ];
                return !!img && visible( img );
        }
-       return ( /input|select|textarea|button|object/.test( nodeName ) ?
+       return ( /^(input|select|textarea|button|object)$/.test( nodeName ) ?
                !element.disabled :
                "a" === nodeName ?
                        element.href || isTabIndexNotNaN :
index 722fa7f..2d412bd 100644 (file)
@@ -1,8 +1,8 @@
 /*!
- * jQuery UI Draggable 1.11.2
+ * jQuery UI Draggable 1.11.4
  * http://jqueryui.com
  *
- * Copyright 2014 jQuery Foundation and other contributors
+ * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  *
@@ -26,7 +26,7 @@
 }(function( $ ) {
 
 $.widget("ui.draggable", $.ui.mouse, {
-       version: "1.11.2",
+       version: "1.11.4",
        widgetEventPrefix: "drag",
        options: {
                addClasses: true,
@@ -800,6 +800,9 @@ $.ui.plugin.add( "draggable", "connectToSortable", {
                                if ( !sortable.isOver ) {
                                        sortable.isOver = 1;
 
+                                       // Store draggable's parent in case we need to reappend to it later.
+                                       draggable._parent = ui.helper.parent();
+
                                        sortable.currentItem = ui.helper
                                                .appendTo( sortable.element )
                                                .data( "ui-sortable-item", true );
@@ -876,8 +879,9 @@ $.ui.plugin.add( "draggable", "connectToSortable", {
                                                sortable.placeholder.remove();
                                        }
 
-                                       // Recalculate the draggable's offset considering the sortable
-                                       // may have modified them in unexpected ways (#8809)
+                                       // Restore and recalculate the draggable's offset considering the sortable
+                                       // may have modified them in unexpected ways. (#8809, #10669)
+                                       ui.helper.appendTo( draggable._parent );
                                        draggable._refreshOffsets( event );
                                        ui.position = draggable._generatePosition( event, true );
 
index 341f6e1..593b66a 100644 (file)
@@ -1,8 +1,8 @@
 /*!
- * jQuery UI Droppable 1.11.2
+ * jQuery UI Droppable 1.11.4
  * http://jqueryui.com
  *
- * Copyright 2014 jQuery Foundation and other contributors
+ * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  *
@@ -27,7 +27,7 @@
 }(function( $ ) {
 
 $.widget( "ui.droppable", {
-       version: "1.11.2",
+       version: "1.11.4",
        widgetEventPrefix: "drop",
        options: {
                accept: "*",
index 5304b98..89018bf 100644 (file)
@@ -1,8 +1,8 @@
 /*!
- * jQuery UI Mouse 1.11.2
+ * jQuery UI Mouse 1.11.4
  * http://jqueryui.com
  *
- * Copyright 2014 jQuery Foundation and other contributors
+ * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  *
@@ -29,7 +29,7 @@ $( document ).mouseup( function() {
 });
 
 return $.widget("ui.mouse", {
-       version: "1.11.2",
+       version: "1.11.4",
        options: {
                cancel: "input,textarea,button,select,option",
                distance: 1,
index 73be3f8..bb97a5b 100644 (file)
@@ -1,8 +1,8 @@
 /*!
- * jQuery UI Position 1.11.2
+ * jQuery UI Position 1.11.4
  * http://jqueryui.com
  *
- * Copyright 2014 jQuery Foundation and other contributors
+ * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  *
@@ -448,12 +448,12 @@ $.ui.position = {
                                newOverBottom;
                        if ( overTop < 0 ) {
                                newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
-                               if ( ( position.top + myOffset + atOffset + offset) > overTop && ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) ) {
+                               if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) {
                                        position.top += myOffset + atOffset + offset;
                                }
                        } else if ( overBottom > 0 ) {
                                newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
-                               if ( ( position.top + myOffset + atOffset + offset) > overBottom && ( newOverTop > 0 || abs( newOverTop ) < overBottom ) ) {
+                               if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) {
                                        position.top += myOffset + atOffset + offset;
                                }
                        }
index 82a15e5..c45ff3b 100644 (file)
@@ -1,8 +1,8 @@
 /*!
- * jQuery UI Resizable 1.11.2
+ * jQuery UI Resizable 1.11.4
  * http://jqueryui.com
  *
- * Copyright 2014 jQuery Foundation and other contributors
+ * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  *
@@ -26,7 +26,7 @@
 }(function( $ ) {
 
 $.widget("ui.resizable", $.ui.mouse, {
-       version: "1.11.2",
+       version: "1.11.4",
        widgetEventPrefix: "resize",
        options: {
                alsoResize: false,
@@ -99,7 +99,7 @@ $.widget("ui.resizable", $.ui.mouse, {
                });
 
                // Wrap the element if it cannot hold child nodes
-               if (this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
+               if (this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)) {
 
                        this.element.wrap(
                                $("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
@@ -160,7 +160,8 @@ $.widget("ui.resizable", $.ui.mouse, {
                                        nw: ".ui-resizable-nw"
                                } );
 
-               if (this.handles.constructor === String) {
+               this._handles = $();
+               if ( this.handles.constructor === String ) {
 
                        if ( this.handles === "all") {
                                this.handles = "n,e,s,w,se,sw,ne,nw";
@@ -198,9 +199,12 @@ $.widget("ui.resizable", $.ui.mouse, {
 
                                if (this.handles[i].constructor === String) {
                                        this.handles[i] = this.element.children( this.handles[ i ] ).first().show();
+                               } else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) {
+                                       this.handles[ i ] = $( this.handles[ i ] );
+                                       this._on( this.handles[ i ], { "mousedown": that._mouseDown });
                                }
 
-                               if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
+                               if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)) {
 
                                        axis = $(this.handles[i], this.element);
 
@@ -214,21 +218,17 @@ $.widget("ui.resizable", $.ui.mouse, {
                                        target.css(padPos, padWrapper);
 
                                        this._proportionallyResize();
-
                                }
 
-                               // TODO: What's that good for? There's not anything to be executed left
-                               if (!$(this.handles[i]).length) {
-                                       continue;
-                               }
+                               this._handles = this._handles.add( this.handles[ i ] );
                        }
                };
 
                // TODO: make renderAxis a prototype function
                this._renderAxis(this.element);
 
-               this._handles = $(".ui-resizable-handle", this.element)
-                       .disableSelection();
+               this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) );
+               this._handles.disableSelection();
 
                this._handles.mouseover(function() {
                        if (!that.resizing) {
@@ -262,7 +262,6 @@ $.widget("ui.resizable", $.ui.mouse, {
                }
 
                this._mouseInit();
-
        },
 
        _destroy: function() {
@@ -943,7 +942,7 @@ $.ui.plugin.add( "resizable", "containment", {
                        }
                }
 
-               if ( !continueResize ){
+               if ( !continueResize ) {
                        that.position.left = that.prevPosition.left;
                        that.position.top = that.prevPosition.top;
                        that.size.width = that.prevSize.width;
@@ -984,29 +983,15 @@ $.ui.plugin.add("resizable", "alsoResize", {
 
        start: function() {
                var that = $(this).resizable( "instance" ),
-                       o = that.options,
-                       _store = function(exp) {
-                               $(exp).each(function() {
-                                       var el = $(this);
-                                       el.data("ui-resizable-alsoresize", {
-                                               width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
-                                               left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10)
-                                       });
-                               });
-                       };
+                       o = that.options;
 
-               if (typeof(o.alsoResize) === "object" && !o.alsoResize.parentNode) {
-                       if (o.alsoResize.length) {
-                               o.alsoResize = o.alsoResize[0];
-                               _store(o.alsoResize);
-                       } else {
-                               $.each(o.alsoResize, function(exp) {
-                                       _store(exp);
-                               });
-                       }
-               } else {
-                       _store(o.alsoResize);
-               }
+               $(o.alsoResize).each(function() {
+                       var el = $(this);
+                       el.data("ui-resizable-alsoresize", {
+                               width: parseInt(el.width(), 10), height: parseInt(el.height(), 10),
+                               left: parseInt(el.css("left"), 10), top: parseInt(el.css("top"), 10)
+                       });
+               });
        },
 
        resize: function(event, ui) {
@@ -1019,35 +1004,23 @@ $.ui.plugin.add("resizable", "alsoResize", {
                                width: (that.size.width - os.width) || 0,
                                top: (that.position.top - op.top) || 0,
                                left: (that.position.left - op.left) || 0
-                       },
+                       };
 
-                       _alsoResize = function(exp, c) {
-                               $(exp).each(function() {
-                                       var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {},
-                                               css = c && c.length ?
-                                                       c :
-                                                       el.parents(ui.originalElement[0]).length ?
-                                                               [ "width", "height" ] :
-                                                               [ "width", "height", "top", "left" ];
-
-                                       $.each(css, function(i, prop) {
-                                               var sum = (start[prop] || 0) + (delta[prop] || 0);
-                                               if (sum && sum >= 0) {
-                                                       style[prop] = sum || null;
-                                               }
-                                       });
-
-                                       el.css(style);
+                       $(o.alsoResize).each(function() {
+                               var el = $(this), start = $(this).data("ui-resizable-alsoresize"), style = {},
+                                       css = el.parents(ui.originalElement[0]).length ?
+                                                       [ "width", "height" ] :
+                                                       [ "width", "height", "top", "left" ];
+
+                               $.each(css, function(i, prop) {
+                                       var sum = (start[prop] || 0) + (delta[prop] || 0);
+                                       if (sum && sum >= 0) {
+                                               style[prop] = sum || null;
+                                       }
                                });
-                       };
 
-               if (typeof(o.alsoResize) === "object" && !o.alsoResize.nodeType) {
-                       $.each(o.alsoResize, function(exp, c) {
-                               _alsoResize(exp, c);
+                               el.css(style);
                        });
-               } else {
-                       _alsoResize(o.alsoResize);
-               }
        },
 
        stop: function() {
@@ -1165,7 +1138,7 @@ $.ui.plugin.add("resizable", "grid", {
                                that.size.width = newWidth;
                                that.position.left = op.left - ox;
                        } else {
-                               newWidth = gridY - outerDimensions.height;
+                               newWidth = gridX - outerDimensions.width;
                                that.size.width = newWidth;
                                that.position.left = op.left + os.width - newWidth;
                        }
index d3c4285..04b3dc6 100644 (file)
@@ -1,8 +1,8 @@
 /*!
- * jQuery UI Selectable 1.11.2
+ * jQuery UI Selectable 1.11.4
  * http://jqueryui.com
  *
- * Copyright 2014 jQuery Foundation and other contributors
+ * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  *
@@ -26,7 +26,7 @@
 }(function( $ ) {
 
 return $.widget("ui.selectable", $.ui.mouse, {
-       version: "1.11.2",
+       version: "1.11.4",
        options: {
                appendTo: "body",
                autoRefresh: true,
index 948fda3..10f4f10 100644 (file)
@@ -1,8 +1,8 @@
 /*!
- * jQuery UI Sortable 1.11.2
+ * jQuery UI Sortable 1.11.4
  * http://jqueryui.com
  *
- * Copyright 2014 jQuery Foundation and other contributors
+ * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  *
@@ -26,7 +26,7 @@
 }(function( $ ) {
 
 return $.widget("ui.sortable", $.ui.mouse, {
-       version: "1.11.2",
+       version: "1.11.4",
        widgetEventPrefix: "sort",
        ready: false,
        options: {
@@ -77,17 +77,12 @@ return $.widget("ui.sortable", $.ui.mouse, {
        },
 
        _create: function() {
-
-               var o = this.options;
                this.containerCache = {};
                this.element.addClass("ui-sortable");
 
                //Get the items
                this.refresh();
 
-               //Let's determine if the items are being displayed horizontally
-               this.floating = this.items.length ? o.axis === "x" || this._isFloating(this.items[0].item) : false;
-
                //Let's determine the parent's offset
                this.offset = this.element.offset();
 
@@ -276,7 +271,7 @@ return $.widget("ui.sortable", $.ui.mouse, {
                }
 
                //Prepare scrolling
-               if(this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") {
+               if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
                        this.overflowOffset = this.scrollParent.offset();
                }
 
@@ -328,7 +323,7 @@ return $.widget("ui.sortable", $.ui.mouse, {
 
                //Do scrolling
                if(this.options.scroll) {
-                       if(this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") {
+                       if(this.scrollParent[0] !== this.document[0] && this.scrollParent[0].tagName !== "HTML") {
 
                                if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
                                        this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
@@ -344,16 +339,16 @@ return $.widget("ui.sortable", $.ui.mouse, {
 
                        } else {
 
-                               if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
-                                       scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
-                               } else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
-                                       scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
+                               if(event.pageY - this.document.scrollTop() < o.scrollSensitivity) {
+                                       scrolled = this.document.scrollTop(this.document.scrollTop() - o.scrollSpeed);
+                               } else if(this.window.height() - (event.pageY - this.document.scrollTop()) < o.scrollSensitivity) {
+                                       scrolled = this.document.scrollTop(this.document.scrollTop() + o.scrollSpeed);
                                }
 
-                               if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
-                                       scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
-                               } else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
-                                       scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
+                               if(event.pageX - this.document.scrollLeft() < o.scrollSensitivity) {
+                                       scrolled = this.document.scrollLeft(this.document.scrollLeft() - o.scrollSpeed);
+                               } else if(this.window.width() - (event.pageX - this.document.scrollLeft()) < o.scrollSensitivity) {
+                                       scrolled = this.document.scrollLeft(this.document.scrollLeft() + o.scrollSpeed);
                                }
 
                        }
@@ -452,10 +447,10 @@ return $.widget("ui.sortable", $.ui.mouse, {
                                animation = {};
 
                        if ( !axis || axis === "x" ) {
-                               animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft);
+                               animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollLeft);
                        }
                        if ( !axis || axis === "y" ) {
-                               animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop);
+                               animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === this.document[0].body ? 0 : this.offsetParent[0].scrollTop);
                        }
                        this.reverting = true;
                        $(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() {
@@ -648,7 +643,7 @@ return $.widget("ui.sortable", $.ui.mouse, {
 
                if(connectWith && connected) {
                        for (i = connectWith.length - 1; i >= 0; i--){
-                               cur = $(connectWith[i]);
+                               cur = $(connectWith[i], this.document[0]);
                                for ( j = cur.length - 1; j >= 0; j--){
                                        inst = $.data(cur[j], this.widgetFullName);
                                        if(inst && inst !== this && !inst.options.disabled) {
@@ -698,7 +693,7 @@ return $.widget("ui.sortable", $.ui.mouse, {
 
                if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
                        for (i = connectWith.length - 1; i >= 0; i--){
-                               cur = $(connectWith[i]);
+                               cur = $(connectWith[i], this.document[0]);
                                for (j = cur.length - 1; j >= 0; j--){
                                        inst = $.data(cur[j], this.widgetFullName);
                                        if(inst && inst !== this && !inst.options.disabled) {
@@ -731,6 +726,11 @@ return $.widget("ui.sortable", $.ui.mouse, {
 
        refreshPositions: function(fast) {
 
+               // Determine whether items are being displayed horizontally
+               this.floating = this.items.length ?
+                       this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) :
+                       false;
+
                //This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
                if(this.offsetParent && this.helper) {
                        this.offset.parent = this._getParentOffset();
@@ -788,12 +788,13 @@ return $.widget("ui.sortable", $.ui.mouse, {
                                                        .addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
                                                        .removeClass("ui-sortable-helper");
 
-                                       if ( nodeName === "tr" ) {
-                                               that.currentItem.children().each(function() {
-                                                       $( "<td>&#160;</td>", that.document[0] )
-                                                               .attr( "colspan", $( this ).attr( "colspan" ) || 1 )
-                                                               .appendTo( element );
-                                               });
+                                       if ( nodeName === "tbody" ) {
+                                               that._createTrPlaceholder(
+                                                       that.currentItem.find( "tr" ).eq( 0 ),
+                                                       $( "<tr>", that.document[ 0 ] ).appendTo( element )
+                                               );
+                                       } else if ( nodeName === "tr" ) {
+                                               that._createTrPlaceholder( that.currentItem, element );
                                        } else if ( nodeName === "img" ) {
                                                element.attr( "src", that.currentItem.attr( "src" ) );
                                        }
@@ -830,6 +831,16 @@ return $.widget("ui.sortable", $.ui.mouse, {
 
        },
 
+       _createTrPlaceholder: function( sourceTr, targetTr ) {
+               var that = this;
+
+               sourceTr.children().each(function() {
+                       $( "<td>&#160;</td>", that.document[ 0 ] )
+                               .attr( "colspan", $( this ).attr( "colspan" ) || 1 )
+                               .appendTo( targetTr );
+               });
+       },
+
        _contactContainers: function(event) {
                var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, floating, axis,
                        innermostContainer = null,
@@ -990,14 +1001,14 @@ return $.widget("ui.sortable", $.ui.mouse, {
                // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
                // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
                //    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
-               if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
+               if(this.cssPosition === "absolute" && this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) {
                        po.left += this.scrollParent.scrollLeft();
                        po.top += this.scrollParent.scrollTop();
                }
 
                // This needs to be actually done for all browsers, since pageX/pageY includes this information
                // with an ugly IE fix
-               if( this.offsetParent[0] === document.body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
+               if( this.offsetParent[0] === this.document[0].body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
                        po = { top: 0, left: 0 };
                }
 
@@ -1047,8 +1058,8 @@ return $.widget("ui.sortable", $.ui.mouse, {
                        this.containment = [
                                0 - this.offset.relative.left - this.offset.parent.left,
                                0 - this.offset.relative.top - this.offset.parent.top,
-                               $(o.containment === "document" ? document : window).width() - this.helperProportions.width - this.margins.left,
-                               ($(o.containment === "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
+                               o.containment === "document" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left,
+                               (o.containment === "document" ? this.document.width() : this.window.height() || this.document[0].body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
                        ];
                }
 
@@ -1073,7 +1084,7 @@ return $.widget("ui.sortable", $.ui.mouse, {
                        pos = this.position;
                }
                var mod = d === "absolute" ? 1 : -1,
-                       scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
+                       scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
                        scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
 
                return {
@@ -1099,13 +1110,13 @@ return $.widget("ui.sortable", $.ui.mouse, {
                        o = this.options,
                        pageX = event.pageX,
                        pageY = event.pageY,
-                       scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+                       scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== this.document[0] && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
 
                // This is another very weird special case that only happens for relative elements:
                // 1. If the css position is relative
                // 2. and the scroll parent is the document or similar to the offset parent
                // we have to refresh the relative offset during the scroll so there are no jumps
-               if(this.cssPosition === "relative" && !(this.scrollParent[0] !== document && this.scrollParent[0] !== this.offsetParent[0])) {
+               if(this.cssPosition === "relative" && !(this.scrollParent[0] !== this.document[0] && this.scrollParent[0] !== this.offsetParent[0])) {
                        this.offset.relative = this._getRelativeOffset();
                }
 
index c2fb788..1096ba6 100644 (file)
@@ -1,8 +1,8 @@
 /*!
- * jQuery UI Widget 1.11.2
+ * jQuery UI Widget 1.11.4
  * http://jqueryui.com
  *
- * Copyright 2014 jQuery Foundation and other contributors
+ * Copyright jQuery Foundation and other contributors
  * Released under the MIT license.
  * http://jquery.org/license
  *
@@ -190,11 +190,6 @@ $.widget.bridge = function( name, object ) {
                        args = widget_slice.call( arguments, 1 ),
                        returnValue = this;
 
-               // allow multiple hashes to be passed on init
-               options = !isMethodCall && args.length ?
-                       $.widget.extend.apply( null, [ options ].concat(args) ) :
-                       options;
-
                if ( isMethodCall ) {
                        this.each(function() {
                                var methodValue,
@@ -219,6 +214,12 @@ $.widget.bridge = function( name, object ) {
                                }
                        });
                } else {
+
+                       // Allow multiple hashes to be passed on init
+                       if ( args.length ) {
+                               options = $.widget.extend.apply( null, [ options ].concat(args) );
+                       }
+
                        this.each(function() {
                                var instance = $.data( this, fullName );
                                if ( instance ) {