Ticket #3328: containment_in_overflow_hidden.diff
| File containment_in_overflow_hidden.diff, 2.2 KB (added by c_t, 2 years ago) |
|---|
|
Make containment-restriction work for containers with overflow:hidden |
-
ui.core.js
283 283 .unbind('selectstart.ui'); 284 284 }, 285 285 hasScroll: function(e, a) { 286 // We can assume, that the element has no scrollbars if it's overflow is set to hidden 287 if ($(e).css('overflow') == 'hidden') { return false; } 288 286 289 var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop', 287 290 has = false; 288 291 -
ui.draggable.js
118 118 if(!(/^(document|window|parent)$/).test(o.containment)) { 119 119 var ce = $(o.containment)[0]; 120 120 var co = $(o.containment).offset(); 121 var over = ($(ce).css("overflow") != 'hidden'); 121 122 122 123 this.containment = [ 123 124 co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) - this.offset.relative.left - this.offset.parent.left, 124 125 co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) - this.offset.relative.top - this.offset.parent.top, 125 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),126 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)126 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), 127 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) 127 128 ]; 128 129 } 129 130 }
![(please configure the [header_logo] section in trac.ini)](/chrome/site/nologo.gif)