comparison core/misc/dialog/dialog.js @ 4:a9cd425dd02b

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:11:55 +0000
parents c75dbcec494b
children
comparison
equal deleted inserted replaced
3:307d7a7fd348 4:a9cd425dd02b
21 Drupal.dialog = function (element, options) { 21 Drupal.dialog = function (element, options) {
22 var undef = void 0; 22 var undef = void 0;
23 var $element = $(element); 23 var $element = $(element);
24 var dialog = { 24 var dialog = {
25 open: false, 25 open: false,
26 returnValue: undef, 26 returnValue: undef
27 show: function show() {
28 openDialog({ modal: false });
29 },
30 showModal: function showModal() {
31 openDialog({ modal: true });
32 },
33
34 close: closeDialog
35 }; 27 };
36 28
37 function openDialog(settings) { 29 function openDialog(settings) {
38 settings = $.extend({}, drupalSettings.dialog, options, settings); 30 settings = $.extend({}, drupalSettings.dialog, options, settings);
39 31
49 dialog.returnValue = value; 41 dialog.returnValue = value;
50 dialog.open = false; 42 dialog.open = false;
51 $(window).trigger('dialog:afterclose', [dialog, $element]); 43 $(window).trigger('dialog:afterclose', [dialog, $element]);
52 } 44 }
53 45
46 dialog.show = function () {
47 openDialog({ modal: false });
48 };
49 dialog.showModal = function () {
50 openDialog({ modal: true });
51 };
52 dialog.close = closeDialog;
53
54 return dialog; 54 return dialog;
55 }; 55 };
56 })(jQuery, Drupal, drupalSettings); 56 })(jQuery, Drupal, drupalSettings);