From 3f84aaa7164e0fcf3827bfcfc2c33d775eb418a4 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 7 Oct 2019 18:10:05 +0200 Subject: [PATCH] Add events in form builder manager module --- .../js/WoltLabSuite/Core/Form/Builder/Manager.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 + }); } }; }); -- 2.20.1