aboutsummaryrefslogtreecommitdiff
path: root/js/mediators
diff options
context:
space:
mode:
authorPushkar Joshi2012-04-27 15:05:38 -0700
committerPushkar Joshi2012-04-27 15:05:38 -0700
commitc8fc8e1bd1c394f433b4fc1677f4bc596e7cc2cc (patch)
tree74fcb9818a917d4f8ddb0db0c78a8cff9af86339 /js/mediators
parent28d1594b868e3c08e5603adbd5b29df1e24d57e9 (diff)
parentc8fac64d4ad8ac18744a17a5e0f0d17204355fd6 (diff)
downloadninja-c8fc8e1bd1c394f433b4fc1677f4bc596e7cc2cc.tar.gz
Merge branch 'master' into pentool
Diffstat (limited to 'js/mediators')
-rwxr-xr-xjs/mediators/drag-drop-mediator.js14
-rwxr-xr-xjs/mediators/keyboard-mediator.js2
2 files changed, 8 insertions, 8 deletions
diff --git a/js/mediators/drag-drop-mediator.js b/js/mediators/drag-drop-mediator.js
index eedab8fc..b0aba5b6 100755
--- a/js/mediators/drag-drop-mediator.js
+++ b/js/mediators/drag-drop-mediator.js
@@ -115,25 +115,25 @@ exports.DragDropMediator = Montage.create(Component, {
115 // 115 //
116 if (e.currentTarget.fileType.indexOf('svg') !== -1) { 116 if (e.currentTarget.fileType.indexOf('svg') !== -1) {
117 element = NJUtils.makeNJElement('embed', 'SVG', 'block');//TODO: Verify this is proper 117 element = NJUtils.makeNJElement('embed', 'SVG', 'block');//TODO: Verify this is proper
118 element.type = 'image/svg+xml';
118 element.src = url+'/'+fileName; 119 element.src = url+'/'+fileName;
119 element.type = 'image/svg+xml';
120 } else { 120 } else {
121 element = NJUtils.makeNJElement('image', 'image', 'image'); 121 element = NJUtils.makeNJElement('image', 'image', 'image');
122 element.src = url+'/'+fileName; 122 element.src = url+'/'+fileName;
123 } 123 }
124 //TODO: Remove temp fix for elements to redraw on drop 124 //Adding element once it is loaded
125
126 element.onload = function () { 125 element.onload = function () {
127 self.application.ninja.elementMediator.addElements(element, rules); 126 element.onload = null;
127 self.application.ninja.elementMediator.addElements(element, rules, true);
128 }; 128 };
129 // 129 //Setting rules of element
130 rules = { 130 rules = {
131 'position': 'absolute', 131 'position': 'absolute',
132 'top' : (parseInt(e.currentTarget.filePosition.y) - parseInt(this.application.ninja.stage.userContentTop)) + 'px', 132 'top' : (parseInt(e.currentTarget.filePosition.y) - parseInt(this.application.ninja.stage.userContentTop)) + 'px',
133 'left' : (parseInt(e.currentTarget.filePosition.x) - parseInt(this.application.ninja.stage.userContentLeft)) + 'px' 133 'left' : (parseInt(e.currentTarget.filePosition.x) - parseInt(this.application.ninja.stage.userContentLeft)) + 'px'
134 }; 134 };
135 // 135 //
136 self.application.ninja.elementMediator.addElements(element, rules); 136 self.application.ninja.elementMediator.addElements(element, rules, false);
137 } else { 137 } else {
138 //TODO: HANDLE ERROR ON SAVING FILE TO BE ADDED AS ELEMENT 138 //TODO: HANDLE ERROR ON SAVING FILE TO BE ADDED AS ELEMENT
139 } 139 }
diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js
index 79967799..f8934669 100755
--- a/js/mediators/keyboard-mediator.js
+++ b/js/mediators/keyboard-mediator.js
@@ -180,7 +180,7 @@ exports.KeyboardMediator = Montage.create(Component, {
180 } 180 }
181 181
182 // Shortcut for Eyedropper Tool is I 182 // Shortcut for Eyedropper Tool is I
183 if(evt.keyCode === Keyboard.I ) { 183 if(evt.keyCode === Keyboard.I && !(evt.ctrlKey || evt.metaKey)) {
184 evt.preventDefault(); 184 evt.preventDefault();
185 this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[12]}); 185 this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[12]});
186 return; 186 return;