Changeset 446 for trunk/ui/ui.core.js

Show
Ignore:
Timestamp:
07/10/08 18:57:19 (21 months ago)
Author:
scott.gonzalez
Message:

Core: cleaned up $.ui.hasScroll().

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/ui/ui.core.js

    r440 r446  
    5454        }, 
    5555        hasScroll: function(e, a) { 
    56                 var scroll = /top/.test(a||"top") ? 'scrollTop' : 'scrollLeft', has = false; 
    57                 if (e[scroll] > 0) return true; e[scroll] = 1; 
    58                 has = e[scroll] > 0 ? true : false; e[scroll] = 0; 
     56                var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop', 
     57                        has = false; 
     58                 
     59                if (e[scroll] > 0) { return true; } 
     60                 
     61                // TODO: determine which cases actually cause this to happen 
     62                // if the element doesn't have the scroll set, see if it's possible to 
     63                // set the scroll 
     64                e[scroll] = 1; 
     65                has = (e[scroll] > 0); 
     66                e[scroll] = 0; 
    5967                return has; 
    6068        }