Fix caret position after image update
authorAlexander Ebert <ebert@woltlab.com>
Wed, 28 Sep 2016 10:41:17 +0000 (12:41 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 28 Sep 2016 10:41:17 +0000 (12:41 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabImage.js

index 8e44e783edd43480e40f65ae55e941410b24e2bd..64d31a98f70013c69057eb6e7850033336962ba4 100644 (file)
@@ -67,11 +67,13 @@ $.Redactor.prototype.WoltLabImage = function() {
                                        image.classList.add('messageFloatObject' + WCF.String.ucfirst(float));
                                }
                                
-                               mpUpdate();
+                               mpUpdate.call(this);
                                
                                // remove alt/title attribute again (not supported)
                                image.removeAttribute('alt');
                                image.removeAttribute('title');
+                               
+                               this.caret.after(image);
                        }).bind(this);
                        
                        // overwrite modal template