![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-ui/view/base/web/js/form/ |
/** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** * @api */ define([ 'uiClass', 'jquery', 'underscore', 'uiRegistry' ], function (Class, $, _, registry) { 'use strict'; return Class.extend({ /** * Initialize actions and adapter. * * @param {Object} config * @param {Element} elem * @returns {Object} */ initialize: function (config, elem) { return this._super() .initActions() .initAdapter(elem); }, /** * Creates callback from declared actions. * * @returns {Object} */ initActions: function () { var callbacks = []; _.each(this.actions, function (action) { callbacks.push({ action: registry.async(action.targetName), args: _.union([action.actionName], action.params) }); }); /** * Callback function. */ this.callback = function () { _.each(callbacks, function (callback) { callback.action.apply(callback.action, callback.args); }); }; return this; }, /** * Attach callback handler on button. * * @param {Element} elem */ initAdapter: function (elem) { $(elem).on('click', this.callback); return this; } }); });