From 76a2b28ad340de208a9bb30a82b394e13bb6329f Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 29 Jul 2014 20:23:22 +0200 Subject: [PATCH] Fixed inserting of images w/ alignment --- .../3rdParty/redactor/plugins/wmonkeypatch.js | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js index f677a052fa..bf6d562f96 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js @@ -424,5 +424,34 @@ RedactorPlugins.wmonkeypatch = { callback.call(this, node); }, this ) ); + }, + + /** + * Overwrites $.Redactor.imageCallbackLink() to provide proper image insert behavior. + * + * @see $.Redactor.imageCallbackLink() + */ + imageCallbackLink: function() { + var $src = $.trim($('#redactor_image_source').val()); + if ($src.length) { + var $float = ''; + var $alignment = $('#redactor_form_image_align').val(); + switch ($alignment) { + case 'left': + $float = ' style="float: left;"'; + break; + + case 'right': + $float = ' style="float: right;"'; + break; + } + + var $data = ''; + + this.imageInsert($data, true); + } + else { + this.modalClose(); + } } }; -- 2.20.1