aboutsummaryrefslogtreecommitdiff
path: root/js/clipboard
diff options
context:
space:
mode:
Diffstat (limited to 'js/clipboard')
-rw-r--r--js/clipboard/internal-ops/elements-clipboard-agent.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/js/clipboard/internal-ops/elements-clipboard-agent.js b/js/clipboard/internal-ops/elements-clipboard-agent.js
index 5c4b7d6f..4f6e8195 100644
--- a/js/clipboard/internal-ops/elements-clipboard-agent.js
+++ b/js/clipboard/internal-ops/elements-clipboard-agent.js
@@ -267,7 +267,10 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com
267 styles = null; 267 styles = null;
268 } 268 }
269 269
270 var addDelegate = this.application.ninja.elementMediator.addDelegate;
271 this.application.ninja.elementMediator.addDelegate = null;
270 this.application.ninja.elementMediator.addElements(canvas, styles, false); 272 this.application.ninja.elementMediator.addElements(canvas, styles, false);
273 this.application.ninja.elementMediator.addDelegate = addDelegate;
271 274
272 worldData = sourceCanvas.elementModel.shapeModel ? sourceCanvas.elementModel.shapeModel.GLWorld.exportJSON(): null; 275 worldData = sourceCanvas.elementModel.shapeModel ? sourceCanvas.elementModel.shapeModel.GLWorld.exportJSON(): null;
273 if(worldData) 276 if(worldData)
@@ -349,7 +352,7 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com
349 352
350 pastePositioned:{ 353 pastePositioned:{
351 value: function(element, styles, fromCopy){// for now can wok for both in-place and centered paste 354 value: function(element, styles, fromCopy){// for now can wok for both in-place and centered paste
352 var modObject = [], x,y, newX, newY, counter; 355 var modObject = [], x,y, newX, newY, counter, self = this;
353 356
354 if((typeof fromCopy === "undefined") || (fromCopy && fromCopy === true)){ 357 if((typeof fromCopy === "undefined") || (fromCopy && fromCopy === true)){
355 counter = this.pasteCounter; 358 counter = this.pasteCounter;
@@ -362,11 +365,22 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com
362 newX = styles ? ("" + (styles.left + (25 * counter)) + "px") : "100px"; 365 newX = styles ? ("" + (styles.left + (25 * counter)) + "px") : "100px";
363 newY = styles ? ("" + (styles.top + (25 * counter)) + "px") : "100px"; 366 newY = styles ? ("" + (styles.top + (25 * counter)) + "px") : "100px";
364 367
368 var addDelegate = this.application.ninja.elementMediator.addDelegate;
369 this.application.ninja.elementMediator.addDelegate = null;
365 if(!styles || (styles && !styles.position)){ 370 if(!styles || (styles && !styles.position)){
366 this.application.ninja.elementMediator.addElements(element, null, false); 371 this.application.ninja.elementMediator.addElements(element, null, false);
367 }else if(styles && (styles.position === "absolute")){ 372 }else if(styles && (styles.position === "absolute")){
373 if((element.tagName === "IMG") || (element.getAttribute("type") === "image/svg+xml")){
374 element.onload = function(){
375 element.onload = null;
376 //refresh selection
377 self.application.ninja.stage.needsDraw = true;
378 }
379 }
380
368 this.application.ninja.elementMediator.addElements(element, {"top" : newY, "left" : newX}, false);//displace 381 this.application.ninja.elementMediator.addElements(element, {"top" : newY, "left" : newX}, false);//displace
369 } 382 }
383 this.application.ninja.elementMediator.addDelegate = addDelegate;
370 } 384 }
371 }, 385 },
372 386