From 34484ddb030223f16d401b6c9610e273698981b6 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 16 Aug 2019 15:45:50 +0200 Subject: [PATCH] Support event unbinding for legacy redactor plugins --- wcfsetup/install/files/js/3rdParty/redactor2/redactor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/redactor.js b/wcfsetup/install/files/js/3rdParty/redactor2/redactor.js index 6482b3f7d5..7f23936a86 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/redactor.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/redactor.js @@ -3453,7 +3453,9 @@ } itemContainer.innerHTML = '' + btnObject.title + ''; - itemContainer.children[0].addEventListener('mousedown', (function(event) { + // Use a jQuery event here to support the unbinding of the event listener in + // existing "3rdParty" code. + $(itemContainer.children[0]).on('mousedown', (function(event) { event.preventDefault(); this.dropdown.buildClick(event, btnName, btnObject); -- 2.20.1