Skip to content

Commit

Permalink
Draggable: Handle scrolled windows. Fixes #6181 - Draggable: issue wi…
Browse files Browse the repository at this point in the history
…th containment on position:fixed elements.
  • Loading branch information
Jean-Francois Remy authored and scottgonzalez committed Dec 1, 2010
1 parent eac910f commit e01664a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ui/jquery.ui.draggable.js
Expand Up @@ -333,10 +333,10 @@ $.widget("ui.draggable", $.ui.mouse, {
var o = this.options;
if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
if(o.containment == 'document' || o.containment == 'window') this.containment = [
0 - this.offset.relative.left - this.offset.parent.left,
0 - this.offset.relative.top - this.offset.parent.top,
$(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
(o.containment == 'document' ? 0 : $(window).scrollLeft()) - this.offset.relative.left - this.offset.parent.left,
(o.containment == 'document' ? 0 : $(window).scrollTop()) - this.offset.relative.top - this.offset.parent.top,
(o.containment == 'document' ? 0 : $(window).scrollLeft()) + $(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
(o.containment == 'document' ? 0 : $(window).scrollTop()) + ($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
];

if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) {
Expand Down

1 comment on commit e01664a

@yasinuslu
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm still having http://bugs.jqueryui.com/ticket/6181 issue

Please sign in to comment.