Show
Ignore:
Timestamp:
08/19/08 21:58:19 (3 months ago)
Author:
anekos
Message:

isScrollableを修正

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/vimperator-plugins/trunk/scroll_div.js

    r17905 r17906  
    33  let re = /auto|scroll/i; 
    44 
    5   // FIXME!!!!!!!!  Firebug では overflow になってるのに false になったりする。 
    65  function isScrollable (e, doc) { 
    7     let s = doc.defaultView.getComputedStyle(e, null); 
    8     for each (let n in ['overflow', 'overflow-x', 'overflow-y']) { 
    9       //if (s[n] && s[n].match(/.+/)) liberator.log(n + ':' + s[n]); 
    10       if (s[n] && s[n].match(re)) 
    11         return true; 
     6    try { 
     7      let s = doc.defaultView.getComputedStyle(e, ''); 
     8      if (e.scrollHeight <= e.clientHeight) 
     9        return; 
     10      for each (let n in ['overflow', 'overflowY', 'overflowX']) { 
     11        if (s[n] && s[n].match(re)) 
     12          return true; 
     13      } 
     14    } catch (e) { 
     15      liberator.log(e); 
    1216    } 
    1317  } 
     
    4448    } 
    4549 
    46     liberator.log(result.length); 
     50    liberator.log('scrollableElements: ' + result.length); 
    4751    return result; 
    4852  } 
     
    6266    let es = scrollableElements(); 
    6367    let idx = content.document.__div_scroller_index || 0; 
    64     liberator.log("idx: " + idx); 
    6568    return es[idx]; 
    6669  } 
     
    7174    if (elem) 
    7275      elem.scrollTop += dy; 
    73     //for each (let elem in scrollableElements()) 
     76    //for each (let elem in scrollableElements()) { 
     77    //  liberator.log(elem.tagName); 
     78    //  liberator.log(elem.id); 
    7479    //  elem.scrollTop += dy; 
     80    //} 
    7581  } 
    7682 
     
    8995  ); 
    9096 
     97  scroll(100); 
    9198 
    9299