| Current Path : /var/www/clients/client3/web2/web/vendor/magento/module-ui/view/base/web/js/modal/ |
| Current File : /var/www/clients/client3/web2/web/vendor/magento/module-ui/view/base/web/js/modal/alert.js |
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/**
* @api
*/
define([
'jquery',
'underscore',
'jquery-ui-modules/widget',
'Magento_Ui/js/modal/confirm',
'mage/translate'
], function ($, _) {
'use strict';
$.widget('mage.alert', $.mage.confirm, {
options: {
modalClass: 'confirm',
title: $.mage.__('Attention'),
actions: {
/**
* Callback always - called on all actions.
*/
always: function () {}
},
buttons: [{
text: $.mage.__('OK'),
class: 'action-primary action-accept',
/**
* Click handler.
*/
click: function () {
this.closeModal(true);
}
}]
},
/**
* Close modal window.
*/
closeModal: function () {
this.options.actions.always();
this.element.on('alertclosed', _.bind(this._remove, this));
return this._super();
}
});
return function (config) {
return $('<div></div>').html(config.content).alert(config);
};
});