From e820e70b0bad7dfb5854ef08c98fcd6a3789301b Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 5 Sep 2016 21:02:21 +0200 Subject: [PATCH] Fix/Improve code for media insertion into editor --- .../js/WoltLabSuite/Core/Media/Manager/Editor.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Media/Manager/Editor.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Media/Manager/Editor.js index 5f2e782d67..5f50d7a149 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Media/Manager/Editor.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Media/Manager/Editor.js @@ -263,7 +263,7 @@ define(['Core', 'Dictionary', 'Dom/Traverse', 'Language', 'Ui/Dialog', 'WoltLabS for (var i = 0; i < 4; i++) { size = sizes[i]; - if (item[size + 'ThumbnailHeight']) { + if (item[size + 'ThumbnailHeight'] != 0) { available = size; if (thumbnailSize == size) { @@ -274,12 +274,14 @@ define(['Core', 'Dictionary', 'Dom/Traverse', 'Language', 'Ui/Dialog', 'WoltLabS thumbnailSize = available; - if (!thumbnailSize || thumbnailSize === 'original') { - this._options.editor.insert.html(''); - } - else { - this._options.editor.insert.html(''); + if (!thumbnailSize) thumbnailSize = 'original'; + + var link = item.link; + if (thumbnailSize !== 'original') { + link = item[thumbnailSize + 'ThumbnailLink']; } + + this._options.editor.insert.html(''); } else { this._options.editor.insert.text("[wsm='" + item.mediaID + "'][/wsm]"); -- 2.20.1