- Timestamp:
- Oct 28, 2011, 3:32:48 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.3/themes/default/js/ui/jquery.ui.resizable.js
r9559 r12526 1 1 /* 2 * jQuery UI Resizable 1.8.1 02 * jQuery UI Resizable 1.8.16 3 3 * 4 4 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) … … 177 177 .addClass("ui-resizable-autohide") 178 178 .hover(function() { 179 if (o.disabled) return; 179 180 $(this).removeClass("ui-resizable-autohide"); 180 181 self._handles.show(); 181 182 }, 182 183 function(){ 184 if (o.disabled) return; 183 185 if (!self.resizing) { 184 186 $(this).addClass("ui-resizable-autohide"); … … 292 294 var data = trigger.apply(this, [event, dx, dy]), ie6 = $.browser.msie && $.browser.version < 7, csdif = this.sizeDiff; 293 295 296 // Put this in the mouseDrag handler since the user can start pressing shift while resizing 297 this._updateVirtualBoundaries(event.shiftKey); 294 298 if (this._aspectRatio || event.shiftKey) 295 299 data = this._updateRatio(data, event); … … 349 353 350 354 }, 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 }, 351 381 352 382 _updateCache: function(data) { … … 363 393 var o = this.options, cpos = this.position, csize = this.size, a = this.axis; 364 394 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); 367 397 368 398 if (a == 'sw') { … … 380 410 _respectSize: function(data, event) { 381 411 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, 383 413 ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height), 384 414 isminw = isNumber(data.width) && o.minWidth && (o.minWidth > data.width), isminh = isNumber(data.height) && o.minHeight && (o.minHeight > data.height); … … 520 550 521 551 $.extend($.ui.resizable, { 522 version: "1.8.1 0"552 version: "1.8.16" 523 553 }); 524 554
Note: See TracChangeset
for help on using the changeset viewer.