Changeset 680

Show
Ignore:
Timestamp:
09/16/08 03:38:12 (18 months ago)
Author:
paul.bakaus
Message:

core: hasScroll now checks for overflow hidden, since then the users wants scroll to be hidden
draggable: containment respects overflow hidden (fixes #3328)

Location:
trunk/ui
Files:
2 modified

Legend:

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

    r665 r680  
    284284        }, 
    285285        hasScroll: function(e, a) { 
     286                 
     287                //If overflow is hidden, the element might have extra content, but the user wants to hide it 
     288                if ($(e).css('overflow') == 'hidden') { return false; } 
     289                 
    286290                var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop', 
    287291                        has = false; 
  • trunk/ui/ui.draggable.js

    r676 r680  
    197197                        var ce = $(o.containment)[0]; 
    198198                        var co = $(o.containment).offset(); 
     199                        var over = ($(ce).css("overflow") != 'hidden'); 
    199200                         
    200201                        this.containment = [ 
    201202                                co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left, 
    202203                                co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top, 
    203                                 co.left+Math.max(ce.scrollWidth,ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.element.css("marginRight"),10) || 0), 
    204                                 co.top+Math.max(ce.scrollHeight,ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.element.css("marginBottom"),10) || 0) 
     204                                co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left - this.helperProportions.width - this.margins.left - (parseInt(this.element.css("marginRight"),10) || 0), 
     205                                co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top - this.helperProportions.height - this.margins.top - (parseInt(this.element.css("marginBottom"),10) || 0) 
    205206                        ]; 
    206207                }