root / trunk / patches / getNumericStyle.diff

Revision 1806, 0.6 kB (checked in by alex, 3 years ago)

fixing match

  • style.js

     
    9999        var s = dojo.style.getComputedStyle(element, cssSelector); 
    100100        if (s == ''){ return 0; } 
    101101        if (dojo.lang.isUndefined(s)){ return NaN }; 
    102         var match = s.match(/([\d.]+)([a-z]*)/); 
    103         if (!match || !match[1])  
    104                 return NaN; 
    105         var n = Number(match[1]); 
    106         return (n == 0 || match[2]=='px' ? n : NaN); 
     102        var match = s.match(/([\d\.]+)(px){0,1}/i); 
     103        return match ? Number(match[1]) : NaN; 
    107104} 
    108105 
    109106dojo.style.getMarginWidth = function(node){ 
Note: See TracBrowser for help on using the browser.