From: Matthias Schmidt Date: Mon, 7 Oct 2019 16:10:05 +0000 (+0200) Subject: Add events in form builder manager module X-Git-Tag: 5.2.0_Beta_3~43 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3f84aaa7164e0fcf3827bfcfc2c33d775eb418a4;p=GitHub%2FWoltLab%2FWCF.git Add events in form builder manager module --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Manager.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Manager.js index 9bdcc79e79..2bd57c2eba 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Manager.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Form/Builder/Manager.js @@ -11,11 +11,13 @@ define([ 'Core', 'Dictionary', + 'EventHandler', './Field/Dependency/Manager', './Field/Field' ], function( Core, Dictionary, + EventHandler, FormBuilderFieldDependencyManager, FormBuilderField ) { @@ -141,6 +143,10 @@ define([ _forms.set(formId, form); _fields.set(formId, new Dictionary()); + + EventHandler.fire('WoltLabSuite/Core/Form/Builder/Manager', 'registerForm', { + formId: formId + }); }, /** @@ -153,6 +159,10 @@ define([ throw new Error("Unknown form with id '" + formId + "'."); } + EventHandler.fire('WoltLabSuite/Core/Form/Builder/Manager', 'beforeUnregisterForm', { + formId: formId + }); + _forms.delete(formId); _fields.get(formId).forEach(function(field) { @@ -162,6 +172,10 @@ define([ _fields.delete(formId); FormBuilderFieldDependencyManager.unregister(formId); + + EventHandler.fire('WoltLabSuite/Core/Form/Builder/Manager', 'afterUnregisterForm', { + formId: formId + }); } }; });