Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10245: fix_firefox_scrolling_bug_with_tests.diff

File fix_firefox_scrolling_bug_with_tests.diff, 2.7 kB (added by nik.wakelin, 7 months ago)
  • test/functional/effects5b_test.html

    old new  
     1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
     2        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
     4<head> 
     5  <title>script.aculo.us Effects functional test file</title> 
     6  <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
     7  <script src="../../lib/prototype.js" type="text/javascript"></script> 
     8  <script src="../../src/scriptaculous.js" type="text/javascript"></script> 
     9  <script src="../../src/unittest.js" type="text/javascript"></script> 
     10</head> 
     11<body> 
     12 
     13<div style="height: 200px;">&nbsp;</div> 
     14 
     15<h1>script.aculo.us ScrollTo effect (with floats) functional test</h1> 
     16 
     17(this test only applies to Firefox) 
     18 
     19  <div style="float: right; padding: 10px; background: #ccc; height: 1900px;"> 
     20 
     21    <h2>top of float</h2> 
     22     
     23    <a href="#" onclick="new Effect.ScrollTo('bottom-of-float');return false;">scroll to bottom!</a> 
     24     
     25    <div style="height: 1500px;">&nbsp;</div> 
     26 
     27    <h2 id="bottom-of-float">Bottom of Float</h2> 
     28     
     29    w00t 
     30 
     31  </div> 
     32   
     33  <script> 
     34    window.scrollBy(0, 200); 
     35  </script> 
     36 
     37 
     38</body> 
     39</html> 
  • test/functional/index.html

    old new  
    3535  <li><a href="effects3_test.html" target="test">effects3_test</a></li> 
    3636  <li><a href="effects4_test.html" target="test">effects4_test</a></li> 
    3737  <li><a href="effects5_test.html" target="test">effects5_test</a></li> 
     38  <li><a href="effects5b_test.html" target="test">effects5b_test</a></li> 
    3839  <li><a href="effects6_test.html" target="test">effects6_test</a></li> 
    3940  <li><a href="effect_shake.html" target="test">effect shake</a></li> 
    4041  <li><a href="effects_grow_strink_test.html" target="test">Grow/Shrink</a></li> 
  • src/effects.js

    old new  
    509509  var options = arguments[1] || { }, 
    510510    scrollOffsets = document.viewport.getScrollOffsets(), 
    511511    elementOffsets = $(element).cumulativeOffset(), 
    512     max = (window.height || document.body.scrollHeight) - document.viewport.getHeight();  
     512    max = document.viewport.getScrollOffsets[0] - document.viewport.getHeight();  
    513513 
    514514  if (options.offset) elementOffsets[1] += options.offset; 
    515515