Skip to content
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
5 changes: 3 additions & 2 deletions src/plugins/sortable/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ QueryBuilder.define('sortable', function(options) {
var ghost;
var src;
var moved;
var containment = $(options.containment || document.body);

// Init drag and drop
this.on('afterAddRule afterAddGroup', function(e, node) {
Expand Down Expand Up @@ -73,8 +74,8 @@ QueryBuilder.define('sortable', function(options) {
},
onmove: function(event) {
// make the ghost follow the cursor
ghost[0].style.top = event.clientY - 15 + 'px';
ghost[0].style.left = event.clientX - 15 + 'px';
ghost[0].style.top = event.clientY - containment.offset().top - 15 + 'px';
ghost[0].style.left = event.clientX - containment.offset().left - 15 + 'px';
},
onend: function(event) {
// starting from Interact 1.3.3, onend is called before ondrop
Expand Down