diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-04 17:12:03 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2006-03-04 17:12:03 +0000 |
commit | e3bfd08cbcbffddf53de4f0f6030a794402cf532 (patch) | |
tree | b11b3e823f0ea11fd820f7fe07470b4671a92a53 /actionpack/lib | |
parent | 964b67dd0eb2b43cc8097492c52ce777c534cd11 (diff) | |
download | rails-e3bfd08cbcbffddf53de4f0f6030a794402cf532.tar.gz rails-e3bfd08cbcbffddf53de4f0f6030a794402cf532.tar.bz2 rails-e3bfd08cbcbffddf53de4f0f6030a794402cf532.zip |
Fixed Effect.Appear in effects.js to work with floats in Safari (closes #3524, #3813, #3044) [Thomas Fuchs]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3757 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/javascripts/effects.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/javascripts/effects.js b/actionpack/lib/action_view/helpers/javascripts/effects.js index 91d5348a03..c5183092fd 100644 --- a/actionpack/lib/action_view/helpers/javascripts/effects.js +++ b/actionpack/lib/action_view/helpers/javascripts/effects.js @@ -85,6 +85,12 @@ Element.childrenWithClassName = function(element, className) { function(c) { return Element.hasClassName(c, className) }); } +Element.forceRerendering = function(element) { + var n = document.createTextNode(' '); + $(element).appendChild(n); + Element.remove(n); +} + Array.prototype.call = function() { var args = arguments; this.each(function(f){ f.apply(this, args) }); @@ -545,6 +551,10 @@ Effect.Appear = function(element) { var options = Object.extend({ from: (Element.getStyle(element, 'display') == 'none' ? 0.0 : Element.getOpacity(element) || 0.0), to: 1.0, + // force Safari to render floated elements properly + afterFinishInternal: function(effect) { + Element.forceRerendering(effect.element); + }, beforeSetup: function(effect) { with(Element) { setOpacity(effect.element, effect.options.from); show(effect.element); }} |