diff options
author | Valerio Virgillito | 2012-07-09 12:16:58 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-07-09 12:16:58 -0700 |
commit | 4f1b06a5e6c8a232fb0cd9f9b837b98f554cc4fa (patch) | |
tree | b3a73e821a63076b74c6e61c6d1d49956d8d6307 /js/clipboard | |
parent | bab026fb07f6137ca32cb501f2d7c8167a6bd733 (diff) | |
parent | d00207263caf6b8196b991a681e826b658d0712c (diff) | |
download | ninja-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/clipboard')
-rw-r--r-- | js/clipboard/internal-ops/elements-clipboard-agent.js | 10 |
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 | } |