Skip to content
Snippets Groups Projects
Verified Commit a6ad55b2 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3511168 by grimreaper, tocab, acbramley, smustgrave: Node preview modal: use Drupal API

parent 24dcc8dd
Branches
Tags
3 merge requests!12628#3524738 backport without deprecation,!12477#3532243: JSON support status during updates,!5423Draft: Resolve #3329907 "Test2"
Pipeline #499047 failed
...@@ -34,13 +34,13 @@ ...@@ -34,13 +34,13 @@
const $previewDialog = $( const $previewDialog = $(
`<div>${Drupal.theme('nodePreviewModal')}</div>`, `<div>${Drupal.theme('nodePreviewModal')}</div>`,
).appendTo('body'); ).appendTo('body');
Drupal.dialog($previewDialog, { const confirmationDialog = Drupal.dialog($previewDialog, {
title: Drupal.t('Leave preview?'), title: Drupal.t('Leave preview?'),
buttons: [ buttons: [
{ {
text: Drupal.t('Cancel'), text: Drupal.t('Cancel'),
click() { click() {
$(this).dialog('close'); confirmationDialog.close();
}, },
}, },
{ {
...@@ -50,7 +50,8 @@ ...@@ -50,7 +50,8 @@
}, },
}, },
], ],
}).showModal(); });
confirmationDialog.showModal();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment