Ignore:
Timestamp:
Oct 28, 2011, 3:25:54 PM (13 years ago)
Author:
patdenice
Message:

feature:2487
Update jQuery to 1.6.4 and jQuery UI to 1.8.16

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/themes/default/js/ui/jquery.ui.resizable.js

    r9559 r12525  
    11/*
    2  * jQuery UI Resizable 1.8.10
     2 * jQuery UI Resizable 1.8.16
    33 *
    44 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
     
    177177                                .addClass("ui-resizable-autohide")
    178178                                .hover(function() {
     179                                        if (o.disabled) return;
    179180                                        $(this).removeClass("ui-resizable-autohide");
    180181                                        self._handles.show();
    181182                                },
    182183                                function(){
     184                                        if (o.disabled) return;
    183185                                        if (!self.resizing) {
    184186                                                $(this).addClass("ui-resizable-autohide");
     
    292294                var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff;
    293295
     296                // Put this in the mouseDrag handler since the user can start pressing shift while resizing
     297                this._updateVirtualBoundaries(event.shiftKey);
    294298                if (this._aspectRatio || event.shiftKey)
    295299                        data = this._updateRatio(data, event);
     
    349353
    350354        },
     355
     356    _updateVirtualBoundaries: function(forceAspectRatio) {
     357        var o = this.options, pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b;
     358
     359        b = {
     360            minWidth: isNumber(o.minWidth) ? o.minWidth : 0,
     361            maxWidth: isNumber(o.maxWidth) ? o.maxWidth : Infinity,
     362            minHeight: isNumber(o.minHeight) ? o.minHeight : 0,
     363            maxHeight: isNumber(o.maxHeight) ? o.maxHeight : Infinity
     364        };
     365
     366        if(this._aspectRatio || forceAspectRatio) {
     367            // We want to create an enclosing box whose aspect ration is the requested one
     368            // First, compute the "projected" size for each dimension based on the aspect ratio and other dimension
     369            pMinWidth = b.minHeight * this.aspectRatio;
     370            pMinHeight = b.minWidth / this.aspectRatio;
     371            pMaxWidth = b.maxHeight * this.aspectRatio;
     372            pMaxHeight = b.maxWidth / this.aspectRatio;
     373
     374            if(pMinWidth > b.minWidth) b.minWidth = pMinWidth;
     375            if(pMinHeight > b.minHeight) b.minHeight = pMinHeight;
     376            if(pMaxWidth < b.maxWidth) b.maxWidth = pMaxWidth;
     377            if(pMaxHeight < b.maxHeight) b.maxHeight = pMaxHeight;
     378        }
     379        this._vBoundaries = b;
     380    },
    351381
    352382        _updateCache: function(data) {
     
    363393                var o = this.options, cpos = this.position, csize = this.size, a = this.axis;
    364394
    365                 if (data.height) data.width = (csize.height * this.aspectRatio);
    366                 else if (data.width) data.height = (csize.width / this.aspectRatio);
     395                if (isNumber(data.height)) data.width = (data.height * this.aspectRatio);
     396                else if (isNumber(data.width)) data.height = (data.width / this.aspectRatio);
    367397
    368398                if (a == 'sw') {
     
    380410        _respectSize: function(data, event) {
    381411
    382                 var el = this.helper, o = this.options, pRatio = this._aspectRatio || event.shiftKey, a = this.axis,
     412                var el = this.helper, o = this._vBoundaries, pRatio = this._aspectRatio || event.shiftKey, a = this.axis,
    383413                                ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
    384414                                        isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height);
     
    520550
    521551$.extend($.ui.resizable, {
    522         version: "1.8.10"
     552        version: "1.8.16"
    523553});
    524554
Note: See TracChangeset for help on using the changeset viewer.