diff options
author | Pushkar Joshi | 2012-03-27 09:10:58 -0700 |
---|---|---|
committer | Pushkar Joshi | 2012-03-27 09:10:58 -0700 |
commit | 0c26aff9c19c2b39fca06fa6b3bc76b672204065 (patch) | |
tree | e778f2b9d5d525aa364360d5996536a0a06379bd /js/mediators/drag-drop-mediator.js | |
parent | 753244b4713243ab19ca246be674f0b45fb85b72 (diff) | |
parent | 309dde5a8c4599cef6a1052c1ff9ee1ad8ec5858 (diff) | |
download | ninja-0c26aff9c19c2b39fca06fa6b3bc76b672204065.tar.gz |
Merge branch 'master' into brushtool
Conflicts:
js/controllers/elements/shapes-controller.js
Diffstat (limited to 'js/mediators/drag-drop-mediator.js')
-rwxr-xr-x | js/mediators/drag-drop-mediator.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/js/mediators/drag-drop-mediator.js b/js/mediators/drag-drop-mediator.js index 3a965be5..8663b06e 100755 --- a/js/mediators/drag-drop-mediator.js +++ b/js/mediators/drag-drop-mediator.js | |||
@@ -60,6 +60,17 @@ exports.DragDropMediator = Montage.create(Component, { | |||
60 | var i, files = e.dataTransfer.files, position = {x: e.offsetX, y: e.offsetY}, | 60 | var i, files = e.dataTransfer.files, position = {x: e.offsetX, y: e.offsetY}, |
61 | rootUrl = this.application.ninja.coreIoApi.rootUrl+escape((this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1])), | 61 | rootUrl = this.application.ninja.coreIoApi.rootUrl+escape((this.application.ninja.documentController.documentHackReference.root.split(this.application.ninja.coreIoApi.cloudData.root)[1])), |
62 | rootUri = this.application.ninja.documentController.documentHackReference.root; | 62 | rootUri = this.application.ninja.documentController.documentHackReference.root; |
63 | |||
64 | var xferString = e.dataTransfer.getData("text/plain"); | ||
65 | if(xferString) { | ||
66 | // If the drop is a component, call the delegate with the top,left coordinates | ||
67 | if(xferString.indexOf("componentDrop") > -1) { | ||
68 | if(this.dropDelegate && typeof this.dropDelegate === 'object') { | ||
69 | this.dropDelegate.handleComponentDrop(e.offsetX - this.application.ninja.stage.userContentLeft, e.offsetY - this.application.ninja.stage.userContentTop); | ||
70 | return; | ||
71 | } | ||
72 | } | ||
73 | } | ||
63 | // | 74 | // |
64 | for (i=0; files[i]; i++) { | 75 | for (i=0; files[i]; i++) { |
65 | if (files[i].type.indexOf('image') !== -1) { | 76 | if (files[i].type.indexOf('image') !== -1) { |