Issue #3440676 by Utkarsh_33, smustgrave, catch, bnjmnm, nod_: Trigger a JavaScript deprecation error for dialogClass in forked dialog.js

merge-requests/8500/head
nod_ 2024-06-22 21:44:08 +02:00
parent 1a487f3b7c
commit eeaf9c829e
No known key found for this signature in database
GPG Key ID: 76624892606FA197
1 changed files with 7 additions and 0 deletions

View File

@ -78,6 +78,13 @@ class DrupalDialogEvent extends Event {
function openDialog(settings) { function openDialog(settings) {
settings = $.extend({}, drupalSettings.dialog, options, settings); settings = $.extend({}, drupalSettings.dialog, options, settings);
if (settings.dialogClass) {
Drupal.deprecationError({
message:
'dialogClass is deprecated in drupal:10.4.x and will be removed from drupal:12.0.0.',
});
}
// Trigger a global event to allow scripts to bind events to the dialog. // Trigger a global event to allow scripts to bind events to the dialog.
const event = new DrupalDialogEvent('beforecreate', dialog, settings); const event = new DrupalDialogEvent('beforecreate', dialog, settings);
domElement.dispatchEvent(event); domElement.dispatchEvent(event);