diff options
author | patdenice <patdenice@piwigo.org> | 2011-10-28 13:25:54 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2011-10-28 13:25:54 +0000 |
commit | 2a5be28bc5a0fe4748279bebe23d1be6416fe015 (patch) | |
tree | 19dc0a131baa6ad1b8fb1c96e64c153013785d81 /themes/default/js/ui/jquery.effects.core.js | |
parent | 3ea95e0ebcce5ecd80ac4e95879dae72e9360988 (diff) |
feature:2487
Update jQuery to 1.6.4 and jQuery UI to 1.8.16
git-svn-id: http://piwigo.org/svn/trunk@12525 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'themes/default/js/ui/jquery.effects.core.js')
-rw-r--r-- | themes/default/js/ui/jquery.effects.core.js | 70 |
1 files changed, 43 insertions, 27 deletions
diff --git a/themes/default/js/ui/jquery.effects.core.js b/themes/default/js/ui/jquery.effects.core.js index 9f0ba0533..0faacbfec 100644 --- a/themes/default/js/ui/jquery.effects.core.js +++ b/themes/default/js/ui/jquery.effects.core.js @@ -1,5 +1,5 @@ /* - * jQuery UI Effects 1.8.10 + * jQuery UI Effects 1.8.16 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. @@ -231,12 +231,12 @@ $.effects.animateClass = function(value, duration, easing, callback) { easing = null; } - return this.queue('fx', function() { + return this.queue(function() { var that = $(this), originalStyleAttr = that.attr('style') || ' ', originalStyle = filterStyles(getElementStyles.call(this)), newStyle, - className = that.attr('className'); + className = that.attr('class'); $.each(classAnimationActions, function(i, action) { if (value[action]) { @@ -244,28 +244,27 @@ $.effects.animateClass = function(value, duration, easing, callback) { } }); newStyle = filterStyles(getElementStyles.call(this)); - that.attr('className', className); - - that.animate(styleDifference(originalStyle, newStyle), duration, easing, function() { - $.each(classAnimationActions, function(i, action) { - if (value[action]) { that[action + 'Class'](value[action]); } - }); - // work around bug in IE by clearing the cssText before setting it - if (typeof that.attr('style') == 'object') { - that.attr('style').cssText = ''; - that.attr('style').cssText = originalStyleAttr; - } else { - that.attr('style', originalStyleAttr); + that.attr('class', className); + + that.animate(styleDifference(originalStyle, newStyle), { + queue: false, + duration: duration, + easing: easing, + complete: function() { + $.each(classAnimationActions, function(i, action) { + if (value[action]) { that[action + 'Class'](value[action]); } + }); + // work around bug in IE by clearing the cssText before setting it + if (typeof that.attr('style') == 'object') { + that.attr('style').cssText = ''; + that.attr('style').cssText = originalStyleAttr; + } else { + that.attr('style', originalStyleAttr); + } + if (callback) { callback.apply(this, arguments); } + $.dequeue( this ); } - if (callback) { callback.apply(this, arguments); } }); - - // $.animate adds a function to the end of the queue - // but we want it at the front - var queue = $.queue(this), - anim = queue.splice(queue.length - 1, 1)[0]; - queue.splice(1, 0, anim); - $.dequeue(this); }); }; @@ -307,7 +306,7 @@ $.fn.extend({ /******************************************************************************/ $.extend($.effects, { - version: "1.8.10", + version: "1.8.16", // Saves a set of properties in a data storage save: function(element, set) { @@ -368,9 +367,16 @@ $.extend($.effects, { border: 'none', margin: 0, padding: 0 - }); + }), + active = document.activeElement; element.wrap(wrapper); + + // Fixes #7595 - Elements lose focus when wrapped. + if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { + $( active ).focus(); + } + wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element // transfer positioning properties to the wrapper @@ -395,8 +401,18 @@ $.extend($.effects, { }, removeWrapper: function(element) { - if (element.parent().is('.ui-effects-wrapper')) - return element.parent().replaceWith(element); + var parent, + active = document.activeElement; + + if (element.parent().is('.ui-effects-wrapper')) { + parent = element.parent().replaceWith(element); + // Fixes #7595 - Elements lose focus when wrapped. + if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { + $( active ).focus(); + } + return parent; + } + return element; }, |