Browse Source

Block component drag helper position - account for scroll in the editor canvas

pull/539/head
Michal Tomaszewski 9 years ago
parent
commit
f3cdf351b7
  1. 4
      src/utils/Sorter.js

4
src/utils/Sorter.js

@ -168,8 +168,8 @@ module.exports = Backbone.View.extend({
// TODO: Cache ?!?
var frameRect = frame.getBoundingClientRect();
var ownerDocBodyRect = frame.ownerDocument.body.getBoundingClientRect();
addTop = frameRect.top - ownerDocBodyRect.top;
addLeft = frameRect.left - ownerDocBodyRect.left;
addTop = frameRect.top - ownerDocBodyRect.top - doc.body.scrollTop;
addLeft = frameRect.left - ownerDocBodyRect.left - doc.body.scrollLeft;
}
dragHelperStyle.top = (e.pageY + addTop) + 'px';
dragHelperStyle.left = (e.pageX + addLeft) + 'px';

Loading…
Cancel
Save