From: Alexander Ebert Date: Thu, 10 Aug 2017 12:00:55 +0000 (+0200) Subject: Fixed removal of block element attributes X-Git-Tag: 3.1.0_Alpha_1~51 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=376524e3adb8fb1f1e6112704151dd9682abc3c6;p=GitHub%2FWoltLab%2FWCF.git Fixed removal of block element attributes Fixes #2370 --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabBlock.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabBlock.js index 38be62bd54..302749db4c 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabBlock.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabBlock.js @@ -106,6 +106,28 @@ $.Redactor.prototype.WoltLabBlock = function() { return $(firstBlock); }).bind(this); + + this.block.removeAllAttr = (function(block) { + block = this.block.getBlocks(block); + + var returned = []; + $.each(block, function(i,s) + { + if (typeof s.attributes === 'undefined') + { + returned.push(s); + } + + // WoltLab fix: `attributes` is a live collection + while (s.attributes.length) { + s.removeAttribute(s.attributes[0].name); + } + + returned.push(s); + }); + + return returned; + }).bind(this); }, register: function(tag, arrowKeySupport) {