Changeset 20824 for trunk/themes/default/js/ui/jquery.ui.effect-scale.js
- Timestamp:
- Feb 18, 2013, 10:18:40 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/themes/default/js/ui/jquery.ui.effect-scale.js
r18953 r20824 1 1 /*! 2 * jQuery UI Effects Scale 1. 9.02 * jQuery UI Effects Scale 1.10.1 3 3 * http://jqueryui.com 4 4 * 5 * Copyright 201 2jQuery Foundation and other contributors5 * Copyright 2013 jQuery Foundation and other contributors 6 6 * Released under the MIT license. 7 7 * http://jquery.org/license … … 22 22 original = { 23 23 height: elem.height(), 24 width: elem.width() 24 width: elem.width(), 25 outerHeight: elem.outerHeight(), 26 outerWidth: elem.outerWidth() 25 27 }; 26 28 … … 36 38 { 37 39 height: original.height * factor, 38 width: original.width * factor 40 width: original.width * factor, 41 outerHeight: original.outerHeight * factor, 42 outerWidth: original.outerWidth * factor 39 43 } 40 44 }); … … 75 79 } 76 80 77 options.from = o.from || ( mode === "show" ? { height: 0, width: 0 } : original ); 81 options.from = o.from || ( mode === "show" ? { 82 height: 0, 83 width: 0, 84 outerHeight: 0, 85 outerWidth: 0 86 } : original ); 78 87 options.to = { 79 88 height: original.height * factor.y, … … 103 112 104 113 // Create element 105 var el = $( this ), 106 props = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ], 114 var original, baseline, factor, 115 el = $( this ), 116 props0 = [ "position", "top", "bottom", "left", "right", "width", "height", "overflow", "opacity" ], 107 117 108 118 // Always restore … … 120 130 scale = o.scale || "both", 121 131 origin = o.origin || [ "middle", "center" ], 122 original, baseline, factor, 123 position = el.css( "position" ); 132 position = el.css( "position" ), 133 props = restore ? props0 : props1, 134 zero = { 135 height: 0, 136 width: 0, 137 outerHeight: 0, 138 outerWidth: 0 139 }; 124 140 125 141 if ( mode === "show" ) { … … 133 149 }; 134 150 135 el.from = o.from || original; 136 el.to = o.to || original; 151 if ( o.mode === "toggle" && mode === "show" ) { 152 el.from = o.to || zero; 153 el.to = o.from || original; 154 } else { 155 el.from = o.from || ( mode === "show" ? zero : original ); 156 el.to = o.to || ( mode === "hide" ? zero : original ); 157 } 137 158 138 159 // Set scaling factor … … 171 192 // Vertical props scaling 172 193 if ( factor.from.y !== factor.to.y ) { 173 props = props.concat( cProps ) ;194 props = props.concat( cProps ).concat( props2 ); 174 195 el.from = $.effects.setTransition( el, cProps, factor.from.y, el.from ); 175 196 el.to = $.effects.setTransition( el, cProps, factor.to.y, el.to ); … … 177 198 } 178 199 179 $.effects.save( el, restore ? props : props1);200 $.effects.save( el, props ); 180 201 el.show(); 181 202 $.effects.createWrapper( el ); … … 198 219 vProps = vProps.concat([ "marginTop", "marginBottom" ]).concat(cProps); 199 220 hProps = hProps.concat([ "marginLeft", "marginRight" ]); 200 props2 = props .concat(vProps).concat(hProps);221 props2 = props0.concat(vProps).concat(hProps); 201 222 202 223 el.find( "*[width]" ).each( function(){ … … 204 225 c_original = { 205 226 height: child.height(), 206 width: child.width() 227 width: child.width(), 228 outerHeight: child.outerHeight(), 229 outerWidth: child.outerWidth() 207 230 }; 208 231 if (restore) { … … 212 235 child.from = { 213 236 height: c_original.height * factor.from.y, 214 width: c_original.width * factor.from.x 237 width: c_original.width * factor.from.x, 238 outerHeight: c_original.outerHeight * factor.from.y, 239 outerWidth: c_original.outerWidth * factor.from.x 215 240 }; 216 241 child.to = { 217 242 height: c_original.height * factor.to.y, 218 width: c_original.width * factor.to.x 243 width: c_original.width * factor.to.x, 244 outerHeight: c_original.height * factor.to.y, 245 outerWidth: c_original.width * factor.to.x 219 246 }; 220 247 … … 255 282 el.hide(); 256 283 } 257 $.effects.restore( el, restore ? props : props1);284 $.effects.restore( el, props ); 258 285 if ( !restore ) { 259 286
Note: See TracChangeset
for help on using the changeset viewer.