diff options
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 1a4bfdba..a8bd3b2d 100644 --- a/js/clipboard/internal-ops/elements-clipboard-agent.js +++ b/js/clipboard/internal-ops/elements-clipboard-agent.js | |||
@@ -325,7 +325,7 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com | |||
325 | 325 | ||
326 | pastePositioned:{ | 326 | pastePositioned:{ |
327 | value: function(element, styles, fromCopy){// for now can wok for both in-place and centered paste | 327 | value: function(element, styles, fromCopy){// for now can wok for both in-place and centered paste |
328 | var modObject = [], x,y, newX, newY, counter; | 328 | var modObject = [], x,y, newX, newY, counter, self = this, addElementsFlag = true; |
329 | 329 | ||
330 | if((typeof fromCopy === "undefined") || (fromCopy && fromCopy === true)){ | 330 | if((typeof fromCopy === "undefined") || (fromCopy && fromCopy === true)){ |
331 | counter = this.pasteCounter; | 331 | counter = this.pasteCounter; |
@@ -341,6 +341,14 @@ var ElementsClipboardAgent = exports.ElementsClipboardAgent = Montage.create(Com | |||
341 | if(!styles || (styles && !styles.position)){ | 341 | if(!styles || (styles && !styles.position)){ |
342 | this.application.ninja.elementMediator.addElements(element, null, false); | 342 | this.application.ninja.elementMediator.addElements(element, null, false); |
343 | }else if(styles && (styles.position === "absolute")){ | 343 | }else if(styles && (styles.position === "absolute")){ |
344 | if((element.tagName === "IMG") || (element.getAttribute("type") === "image/svg+xml")){ | ||
345 | element.onload = function(){ | ||
346 | element.onload = null; | ||
347 | //refresh selection | ||
348 | self.application.ninja.stage.needsDraw = true; | ||
349 | } | ||
350 | } | ||
351 | |||
344 | this.application.ninja.elementMediator.addElements(element, {"top" : newY, "left" : newX}, false);//displace | 352 | this.application.ninja.elementMediator.addElements(element, {"top" : newY, "left" : newX}, false);//displace |
345 | } | 353 | } |
346 | } | 354 | } |