X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmisc%2Fdialog%2Fdialog.es6.js;h=9b3aaffd7b94ec397cea673e55db8d65971d1435;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=545afc34ca79dd0f96ed32adc6c8c9ba7ddaa93d;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;p=yaffs-website diff --git a/web/core/misc/dialog/dialog.es6.js b/web/core/misc/dialog/dialog.es6.js index 545afc34c..9b3aaffd7 100644 --- a/web/core/misc/dialog/dialog.es6.js +++ b/web/core/misc/dialog/dialog.es6.js @@ -5,7 +5,7 @@ * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/commands.html#the-dialog-element */ -(function ($, Drupal, drupalSettings) { +(function($, Drupal, drupalSettings) { /** * Default dialog options. * @@ -59,19 +59,12 @@ * @return {Drupal.dialog~dialogDefinition} * The dialog instance. */ - Drupal.dialog = function (element, options) { + Drupal.dialog = function(element, options) { let undef; const $element = $(element); const dialog = { open: false, returnValue: undef, - show() { - openDialog({ modal: false }); - }, - showModal() { - openDialog({ modal: true }); - }, - close: closeDialog, }; function openDialog(settings) { @@ -91,6 +84,14 @@ $(window).trigger('dialog:afterclose', [dialog, $element]); } + dialog.show = () => { + openDialog({ modal: false }); + }; + dialog.showModal = () => { + openDialog({ modal: true }); + }; + dialog.close = closeDialog; + return dialog; }; -}(jQuery, Drupal, drupalSettings)); +})(jQuery, Drupal, drupalSettings);