![]() 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/cartforge.co/pub/static/frontend/Magento/blank/en_US/mage/ |
/** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** * @deprecated since version 2.2.0 */ define([ 'jquery', 'jquery-ui-modules/widget' ], function ($) { 'use strict'; /** * This widget is used to tag a DOM element as deletable. By default, it will use the click event on the item with a * data role of delete to trigger the deletion. */ $.widget('mage.deletableItem', { options: { deleteEvent: 'click', deleteSelector: '[data-role="delete"]', hiddenClass: 'no-display' }, /** * This method binds elements found in this widget. */ _bind: function () { var handlers = {}; // since the first handler is dynamic, generate the object using array notation handlers[this.options.deleteEvent + ' ' + this.options.deleteSelector] = '_onDeleteClicked'; handlers.hideDelete = '_onHideDelete'; handlers.showDelete = '_onShowDelete'; this._on(handlers); }, /** * This method constructs a new widget. */ _create: function () { this._bind(); }, /** * This method is to initialize the control * @private */ _init: function () { this._onHideDelete(); // by default, hide the control }, /** * This method removes the entity from the DOM. * @private */ _onDeleteClicked: function (e) { e.stopPropagation(); this.element.trigger('deleteItem'); }, /** * This method hides the delete capability of this item (i.e. making it not deletable) * @private */ _onHideDelete: function () { this.element.find(this.options.deleteSelector).addClass(this.options.hiddenClass); }, /** * This method shows the delete capability of this item (i.e. making it deletable) * @private */ _onShowDelete: function () { this.element.find(this.options.deleteSelector).removeClass(this.options.hiddenClass); } }); return $.mage.deletableItem; });