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

Changeset 8796

Show
Ignore:
Timestamp:
02/03/08 19:36:35 (7 months ago)
Author:
tobie
Message:

prototype: Make Element#absolutize and Element#relativize always return element. Closes #10983.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • spinoffs/prototype/trunk/CHANGELOG

    r8769 r8796  
     1* Make Element#absolutize and Element#relativize always return element. Closes #10983. [kangax] 
     2 
    13* Add deprecation extension. [Tobie Langel] 
    24 
  • spinoffs/prototype/trunk/src/dom.js

    r8723 r8796  
    528528  absolutize: function(element) { 
    529529    element = $(element); 
    530     if (element.getStyle('position') == 'absolute') return
     530    if (element.getStyle('position') == 'absolute') return element
    531531    // Position.prepare(); // To be done manually by Scripty when it needs it. 
    532532 
     
    552552  relativize: function(element) { 
    553553    element = $(element); 
    554     if (element.getStyle('position') == 'relative') return
     554    if (element.getStyle('position') == 'relative') return element
    555555    // Position.prepare(); // To be done manually by Scripty when it needs it. 
    556556 
  • spinoffs/prototype/trunk/test/unit/dom.html

    r8724 r8796  
    16451645        assertUndefined(elt._originalLeft, 'absolutize() did not detect absolute positioning'); 
    16461646      }); 
     1647      // invoking on "absolute" positioned element should return element  
     1648      var element = $('absolute_fixed_undefined').setStyle({position: 'absolute'}); 
     1649      assertEqual(element, element.absolutize()); 
     1650    }}, 
     1651     
     1652    testRelativize: function() {with(this) { 
     1653      // invoking on "relative" positioned element should return element 
     1654      var element = $('absolute_fixed_undefined').setStyle({position: 'relative'}); 
     1655      assertEqual(element, element.relativize()); 
    16471656    }}, 
    16481657