From: Alexander Ebert Date: Wed, 27 Aug 2014 20:02:43 +0000 (+0200) Subject: Fixed quote button being enabled in source mode X-Git-Tag: 2.1.0_Alpha_1~386 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cbf0f36ed4123a9c30eef73eed6dc38baa420cce;p=GitHub%2FWoltLab%2FWCF.git Fixed quote button being enabled in source mode --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js index d3b943962b..45f9c47b39 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js @@ -151,19 +151,23 @@ RedactorPlugins.wmonkeypatch = { var self = this; var $editor = this.$editor.get()[0]; - var $toggleButtons = function(searchFor, buttonSelector, inverse, className) { + var $toggleButtons = function(searchFor, buttonSelector, inverse, className, skipInSourceMode) { var $buttons = self.$toolbar.find(buttonSelector); if (parent && parent.closest(searchFor, $editor).length != 0) { $buttons[(inverse ? 'removeClass' : 'addClass')](className); } else { + if (skipInSourceMode && !self.opts.visual) { + return; + } + $buttons[(inverse ? 'addClass' : 'removeClass')](className); } }; $toggleButtons('ul', 'a.re-indent, a.re-outdent', true, 'redactor_button_disabled'); $toggleButtons('inline.inlineCode', 'a.re-__wcf_tt', false, 'redactor_act'); - $toggleButtons('blockquote.quoteBox', 'a.re-__wcf_quote', false, 'redactor_button_disabled'); + $toggleButtons('blockquote.quoteBox', 'a.re-__wcf_quote', false, 'redactor_button_disabled', true); $toggleButtons('sub', 'a.re-subscript', false, 'redactor_act'); $toggleButtons('sup', 'a.re-superscript', false, 'redactor_act'); },