diff options
Diffstat (limited to 'actionpack/lib/action_view/helpers/javascripts/effects.js')
-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); }} |