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);
27 show: function show() {
28 openDialog({ modal: false });
30 showModal: function showModal() {
31 openDialog({ modal: true });
37 function openDialog(settings) {
38 settings = $.extend({}, drupalSettings.dialog, options, settings);
40 $(window).trigger('dialog:beforecreate', [dialog, $element, settings]);
41 $element.dialog(settings);
43 $(window).trigger('dialog:aftercreate', [dialog, $element, settings]);
46 function closeDialog(value) {
47 $(window).trigger('dialog:beforeclose', [dialog, $element]);
48 $element.dialog('close');
49 dialog.returnValue = value;
51 $(window).trigger('dialog:afterclose', [dialog, $element]);
56 })(jQuery, Drupal, drupalSettings);