2 * DO NOT EDIT THIS FILE.
3 * See the following change record for more information,
4 * https://www.drupal.org/node/2815083
8 (function ($, Drupal, drupalSettings) {
9 drupalSettings.dialog = {
13 buttonClass: 'button',
14 buttonPrimaryClass: 'button--primary',
15 close: function close(event) {
16 Drupal.dialog(event.target).close();
17 Drupal.detachBehaviors(event.target, null, 'unload');
21 Drupal.dialog = function (element, options) {
23 var $element = $(element);
29 function openDialog(settings) {
30 settings = $.extend({}, drupalSettings.dialog, options, settings);
32 $(window).trigger('dialog:beforecreate', [dialog, $element, settings]);
33 $element.dialog(settings);
35 $(window).trigger('dialog:aftercreate', [dialog, $element, settings]);
38 function closeDialog(value) {
39 $(window).trigger('dialog:beforeclose', [dialog, $element]);
40 $element.dialog('close');
41 dialog.returnValue = value;
43 $(window).trigger('dialog:afterclose', [dialog, $element]);
46 dialog.show = function () {
47 openDialog({ modal: false });
49 dialog.showModal = function () {
50 openDialog({ modal: true });
52 dialog.close = closeDialog;
56 })(jQuery, Drupal, drupalSettings);