Verified Commit ec9ed869 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

(cherry picked from commit eeaf9c82)
parent 5601dc41
Loading
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -80,6 +80,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);