- Timestamp:
- Oct 28, 2011, 3:32:48 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.3/themes/default/js/ui/jquery.effects.core.js
r9559 r12526 1 1 /* 2 * jQuery UI Effects 1.8.1 02 * jQuery UI Effects 1.8.16 3 3 * 4 4 * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) … … 232 232 } 233 233 234 return this.queue( 'fx',function() {234 return this.queue(function() { 235 235 var that = $(this), 236 236 originalStyleAttr = that.attr('style') || ' ', 237 237 originalStyle = filterStyles(getElementStyles.call(this)), 238 238 newStyle, 239 className = that.attr('class Name');239 className = that.attr('class'); 240 240 241 241 $.each(classAnimationActions, function(i, action) { … … 245 245 }); 246 246 newStyle = filterStyles(getElementStyles.call(this)); 247 that.attr('className', className); 248 249 that.animate(styleDifference(originalStyle, newStyle), duration, easing, function() { 250 $.each(classAnimationActions, function(i, action) { 251 if (value[action]) { that[action + 'Class'](value[action]); } 252 }); 253 // work around bug in IE by clearing the cssText before setting it 254 if (typeof that.attr('style') == 'object') { 255 that.attr('style').cssText = ''; 256 that.attr('style').cssText = originalStyleAttr; 257 } else { 258 that.attr('style', originalStyleAttr); 247 that.attr('class', className); 248 249 that.animate(styleDifference(originalStyle, newStyle), { 250 queue: false, 251 duration: duration, 252 easing: easing, 253 complete: function() { 254 $.each(classAnimationActions, function(i, action) { 255 if (value[action]) { that[action + 'Class'](value[action]); } 256 }); 257 // work around bug in IE by clearing the cssText before setting it 258 if (typeof that.attr('style') == 'object') { 259 that.attr('style').cssText = ''; 260 that.attr('style').cssText = originalStyleAttr; 261 } else { 262 that.attr('style', originalStyleAttr); 263 } 264 if (callback) { callback.apply(this, arguments); } 265 $.dequeue( this ); 259 266 } 260 if (callback) { callback.apply(this, arguments); }261 267 }); 262 263 // $.animate adds a function to the end of the queue264 // but we want it at the front265 var queue = $.queue(this),266 anim = queue.splice(queue.length - 1, 1)[0];267 queue.splice(1, 0, anim);268 $.dequeue(this);269 268 }); 270 269 }; … … 308 307 309 308 $.extend($.effects, { 310 version: "1.8.1 0",309 version: "1.8.16", 311 310 312 311 // Saves a set of properties in a data storage … … 369 368 margin: 0, 370 369 padding: 0 371 }); 370 }), 371 active = document.activeElement; 372 372 373 373 element.wrap(wrapper); 374 375 // Fixes #7595 - Elements lose focus when wrapped. 376 if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { 377 $( active ).focus(); 378 } 379 374 380 wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element 375 381 … … 396 402 397 403 removeWrapper: function(element) { 398 if (element.parent().is('.ui-effects-wrapper')) 399 return element.parent().replaceWith(element); 404 var parent, 405 active = document.activeElement; 406 407 if (element.parent().is('.ui-effects-wrapper')) { 408 parent = element.parent().replaceWith(element); 409 // Fixes #7595 - Elements lose focus when wrapped. 410 if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { 411 $( active ).focus(); 412 } 413 return parent; 414 } 415 400 416 return element; 401 417 },
Note: See TracChangeset
for help on using the changeset viewer.