aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorValerio Virgillito2012-07-09 12:16:58 -0700
committerValerio Virgillito2012-07-09 12:16:58 -0700
commit4f1b06a5e6c8a232fb0cd9f9b837b98f554cc4fa (patch)
treeb3a73e821a63076b74c6e61c6d1d49956d8d6307 /js
parentbab026fb07f6137ca32cb501f2d7c8167a6bd733 (diff)
parentd00207263caf6b8196b991a681e826b658d0712c (diff)
downloadninja-4f1b06a5e6c8a232fb0cd9f9b837b98f554cc4fa.tar.gz
Merge pull request #364 from ananyasen/bugfix-master
Fixed IKNINJA-1763, IKNINJA-1807 - refresh stage after loading image/svg
Diffstat (limited to 'js')
-rw-r--r--js/clipboard/internal-ops/elements-clipboard-agent.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/js/clipboard/internal-ops/elements-clipboard-agent.js b/js/clipboard/internal-ops/elements-clipboard-agent.js
index 14984593..d0ee5997 100644
--- a/js/clipboard/internal-ops/elements-clipboard-agent.js
+++ b/js/clipboard/internal-ops/elements-clipboard-agent.js
@@ -349,7 +349,7 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com
349 349
350 pastePositioned:{ 350 pastePositioned:{
351 value: function(element, styles, fromCopy){// for now can wok for both in-place and centered paste 351 value: function(element, styles, fromCopy){// for now can wok for both in-place and centered paste
352 var modObject = [], x,y, newX, newY, counter; 352 var modObject = [], x,y, newX, newY, counter, self = this;
353 353
354 if((typeof fromCopy === "undefined") || (fromCopy && fromCopy === true)){ 354 if((typeof fromCopy === "undefined") || (fromCopy && fromCopy === true)){
355 counter = this.pasteCounter; 355 counter = this.pasteCounter;
@@ -365,6 +365,14 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com
365 if(!styles || (styles && !styles.position)){ 365 if(!styles || (styles && !styles.position)){
366 this.application.ninja.elementMediator.addElements(element, null, false); 366 this.application.ninja.elementMediator.addElements(element, null, false);
367 }else if(styles && (styles.position === "absolute")){ 367 }else if(styles && (styles.position === "absolute")){
368 if((element.tagName === "IMG") || (element.getAttribute("type") === "image/svg+xml")){
369 element.onload = function(){
370 element.onload = null;
371 //refresh selection
372 self.application.ninja.stage.needsDraw = true;
373 }
374 }
375
368 this.application.ninja.elementMediator.addElements(element, {"top" : newY, "left" : newX}, false);//displace 376 this.application.ninja.elementMediator.addElements(element, {"top" : newY, "left" : newX}, false);//displace
369 } 377 }
370 } 378 }