From: Alexander Ebert Date: Sun, 27 Jul 2014 10:18:48 +0000 (+0200) Subject: Preventing image editing for embedded attachments X-Git-Tag: 2.1.0_Alpha_1~528 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4916d00721e1361ad634f44ab932678e451ac547;p=GitHub%2FWoltLab%2FWCF.git Preventing image editing for embedded attachments --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js index 5ae8ce6016..b757b8583b 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js @@ -77,6 +77,13 @@ RedactorPlugins.wmonkeypatch = { } this.$toolbar.find('a.re-indent, a.re-outdent').addClass('redactor_button_disabled'); + var $mpImageResizeControls = this.imageResizeControls; + this.imageResizeControls = function($image) { + if (!$image.data('attachmentID')) { + $mpImageResizeControls.call(self, $image); + } + }; + this.setOption('modalOpenedCallback', $.proxy(this.modalOpenedCallback, this)); this.setOption('dropdownShowCallback', $.proxy(this.dropdownShowCallback, this));