Verified Commit eeaf9c82 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3440676 by Utkarsh_33, smustgrave, catch, bnjmnm, nod_: Trigger a...

Issue #3440676 by Utkarsh_33, smustgrave, catch, bnjmnm, nod_: Trigger a JavaScript deprecation error for dialogClass in forked dialog.js
parent 1a487f3b
Loading
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -78,6 +78,13 @@ class DrupalDialogEvent extends Event {

    function openDialog(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.
      const event = new DrupalDialogEvent('beforecreate', dialog, settings);
      domElement.dispatchEvent(event);