Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug with position sv-helper on bootstrap modal. #73

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions src/angular-sortable-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,24 @@
if(targetLeft + helperRect.width > containmentRect.left + body.scrollLeft + containmentRect.width) // right boundary
targetLeft = containmentRect.left + body.scrollLeft + containmentRect.width - helperRect.width;
}
this.style.left = targetLeft - body.scrollLeft + 'px';
this.style.top = targetTop - body.scrollTop + 'px';

var add_left = 0;
var add_top = 0;

var scrl_left = 0;
var scrl_top = 0;

var modal_offset = $('.modal-dialog').offset();
if (typeof modal_offset != 'undefined') {
add_left = -(modal_offset.left);
add_top = -(modal_offset.top);
} else {
scrl_left = body.scrollLeft;
scrl_top = body.scrollTop;
}

this.style.left = targetLeft - scrl_left + add_left + 'px';
this.style.top = targetTop - scrl_top + add_top+ 'px';
};

var pointerOffset = {
Expand Down