/** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ /** * @api */ define([ 'jquery', 'mage/template', 'jquery/ui', 'Magento_Ui/js/modal/modal' ], function ($, mageTemplate) { 'use strict'; $.widget('mage.systemMessageDialog', $.mage.modal, { options: { modalClass: 'modal-system-messages', systemMessageTemplate: '<% _.each(data.items, function(item) { %>' + '
  • ' + '<%= item.text %>' + '
  • ' + '<% }); %>' }, /** @inheritdoc */ _create: function () { this.options.title = $('#message-system-all').attr('title'); this._super(); }, /** @inheritdoc */ openModal: function (severity) { var superMethod = $.proxy(this._super, this); $.ajax({ url: this.options.ajaxUrl, type: 'GET', data: { severity: severity } }).done($.proxy(function (data) { var tmpl = mageTemplate(this.options.systemMessageTemplate, { data: { items: data } }); tmpl = $(tmpl); this.element.html( $('