From eda07f5122cc552737fa6f647ef7f6721c4001b8 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Thu, 15 Mar 2012 20:16:25 -0700 Subject: Fixing offset bug for drag-and-drop --- js/mediators/drag-drop-mediator.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/mediators') diff --git a/js/mediators/drag-drop-mediator.js b/js/mediators/drag-drop-mediator.js index cc384704..c8e781a6 100755 --- a/js/mediators/drag-drop-mediator.js +++ b/js/mediators/drag-drop-mediator.js @@ -112,8 +112,8 @@ exports.DragDropMediator = Montage.create(Component, { // rules = { 'position': 'absolute', - 'top' : e.currentTarget.filePosition.y + 'px', - 'left' : e.currentTarget.filePosition.x + 'px' + 'top' : (parseInt(e.currentTarget.filePosition.y) - parseInt(this.application.ninja.stage.userContentTop)) + 'px', + 'left' : (parseInt(e.currentTarget.filePosition.x) - parseInt(this.application.ninja.stage.userContentLeft)) + 'px' }; // NJevent("elementAdding", {el: element, data: rules}); -- cgit v1.2.3