Fixed image being relocated w/o being floated
authorAlexander Ebert <ebert@woltlab.com>
Sat, 18 Jun 2016 17:14:02 +0000 (19:14 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 18 Jun 2016 17:14:07 +0000 (19:14 +0200)
wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js

index 6c89e02d5ac0fe892ba52e4655db3c22845b662b..51796be594c3fbb4acbf2467f0b33bd420c6f341 100644 (file)
@@ -631,7 +631,7 @@ RedactorPlugins.wmonkeypatch = function() {
                                image = image.detach();
                                image.prependTo($parent);
                                
-                               this.caret.setAfter(image);
+                               
                        }).bind(this);
                        
                        this.image.update = (function(image) {
@@ -640,7 +640,13 @@ RedactorPlugins.wmonkeypatch = function() {
                                
                                image.attr('src', $('#redactor-image-link-source').val());
                                this.image.setFloating(image);
-                               $moveImage(image);
+                               
+                               var float = image.css('float');
+                               if (float === 'left' || float === 'right') {
+                                       $moveImage(image);
+                               }
+                               
+                               this.caret.setAfter(image);
                                
                                var link = $('#redactor-image-link-href').val().trim();
                                var anchor = image.closest('a', this.$editor[0]);