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

Issue #3542159 by tom konda: The elementSettings property assignment is...

Issue #3542159 by tom konda: The elementSettings property assignment is redundant in attach() of ajax.js
parent adddba60
Loading
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -57,21 +57,21 @@

      // This class means to submit the form to the action using Ajax.
      once('ajax', '.use-ajax-submit').forEach((el) => {
        const elementSettings = {};

        const elementSettings = {
          // Ajax submits specified in this manner automatically submit to the
          // normal form action.
        elementSettings.url = $(el.form).attr('action');
          url: $(el.form).attr('action'),
          // Form submit button clicks need to tell the form what was clicked so
          // it gets passed in the POST request.
        elementSettings.setClick = true;
          setClick: true,
          // Form buttons use the 'click' event rather than mousedown.
        elementSettings.event = 'click';
          event: 'click',
          // Clicked form buttons look better with the throbber than the progress
          // bar.
        elementSettings.progress = { type: 'throbber' };
        elementSettings.base = el.id;
        elementSettings.element = el;
          progress: { type: 'throbber' },
          base: el.id,
          element: el,
        };

        Drupal.ajax(elementSettings);
      });
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ public function testLogin(): void {
      'CacheTagInvalidationCount' => 0,
      'CacheTagLookupQueryCount' => 13,
      'ScriptCount' => 3,
      'ScriptBytes' => 140083,
      'ScriptBytes' => 140141,
      'StylesheetCount' => 2,
      'StylesheetBytes' => 44024,
    ];
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ public function testFrontAndRecipesPagesEditor(): void {
    }, 'umamiFrontAndRecipePagesEditor');
    $expected = [
      'ScriptCount' => 5,
      'ScriptBytes' => 446101,
      'ScriptBytes' => 446274,
      'StylesheetCount' => 5,
      'StylesheetBytes' => 204350,
    ];