diff --git a/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore.mvc.ui.theme.shared/bootstrap/dom-event-handlers.js b/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore.mvc.ui.theme.shared/bootstrap/dom-event-handlers.js index 25f46a9b0c..1da78f4ede 100644 --- a/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore.mvc.ui.theme.shared/bootstrap/dom-event-handlers.js +++ b/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore.mvc.ui.theme.shared/bootstrap/dom-event-handlers.js @@ -11,10 +11,10 @@ var confirmText = $form.attr('data-confirm'); if (confirmText) { - $form.submit(function(e) { + $form.submit(function (e) { if (!$form.data('abp-confirmed')) { e.preventDefault(); - abp.message.confirm(confirmText).done(function(accepted) { + abp.message.confirm(confirmText).done(function (accepted) { if (accepted) { $form.data('abp-confirmed', true); $form.submit(); @@ -32,6 +32,25 @@ } } + function initializeScript($el) { + $el.findWithSelf('[data-script-class]').each(function () { + var scriptClassName = $(this).attr('data-script-class'); + if (!scriptClassName) { + return; + } + + var scriptClass = eval(scriptClassName); + if (!scriptClass) { + return; + } + + var scriptObject = new scriptClass(); + $el.data('abp-script-object', scriptObject); + + scriptObject.initDom && scriptObject.initDom($el); + }); + } + abp.dom.onNodeAdded(function (args) { args.$el.findWithSelf('[data-toggle="tooltip"]').tooltip({ container: 'body' @@ -42,6 +61,8 @@ }); enableFormFeatures(args.$el.findWithSelf('form'), true); + + initializeScript(args.$el); }); abp.dom.onNodeRemoved(function (args) {