Skip to content
Snippets Groups Projects

Ensure the UI dialog instance exists/is valid in Drupal.dialog.resetSize.

6 unresolved threads

Closes #3472624

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
63 63 * @fires event:dialogContentResize
64 64 */
65 65 function resetSize(event) {
66 // Ensure the UI dialog instance exists/is valid.
67 // If the dialog is closed very rapidly, the jQuery UI instance may have
68 // been destroyed, but debounce might still call this function within the
69 // setTimeout interval.
70 if (!event.data.$element.data('ui-dialog')) {
71 return;
72 }
  • Hervé Donner added 45 commits

    added 45 commits

    • 0394fd6d...79a49040 - 42 commits from branch project:11.x
    • af4d0587 - Ensure the UI dialog instance exists/is valid in Drupal.dialog.resetSize.
    • 76a07133 - Fix JS errors when resizing a window with a dialog containing a CKEditor field.
    • d8947d9b - Call debounce immediately, prevents modal from moving around causing...

    Compare with previous version

  • Hervé Donner added 1 commit

    added 1 commit

    Compare with previous version

  • Hervé Donner added 2 commits

    added 2 commits

    • 79102336 - Fix JS errors when resizing a window with a dialog containing a CKEditor field.
    • 4d97ff80 - Call debounce immediately, prevents modal from moving around causing...

    Compare with previous version

  • 188 223 // Press buttons in the dialog to ensure there are no AJAX errors.
    189 224 $this->assertSession()->elementExists('css', '.ui-dialog-buttonpane')->pressButton('Hello world');
    190 225 $this->assertSession()->assertWaitOnAjaxRequest();
    191 $has_focus_text = $this->getSession()->evaluateScript('document.activeElement.textContent');
    192 $this->assertEquals('Do it', $has_focus_text);
    193 226 $this->assertSession()->elementExists('css', '.ui-dialog-buttonpane')->pressButton('Preview');
    194 227 $this->assertSession()->assertWaitOnAjaxRequest();
    195 $has_focus_text = $this->getSession()->evaluateScript('document.activeElement.textContent');
    196 $this->assertEquals('Do it', $has_focus_text);
  • 188 223 // Press buttons in the dialog to ensure there are no AJAX errors.
    189 224 $this->assertSession()->elementExists('css', '.ui-dialog-buttonpane')->pressButton('Hello world');
    190 225 $this->assertSession()->assertWaitOnAjaxRequest();
    191 $has_focus_text = $this->getSession()->evaluateScript('document.activeElement.textContent');
    192 $this->assertEquals('Do it', $has_focus_text);
  • 69 93 $this->assertNotNull($close_button);
    70 94 $close_button->press();
    71 95
    96 // Test opening and immediately closing modal a few times.
    97 // Ensure no JS errors are thrown.
    98 for ($i = 0; $i < 10; $i++) {
    99 $this->getSession()->getPage()->clickLink('Link 1 (modal)');
    100 $this->assertSession()->waitForElementVisible('css', 'div.ui-dialog');
    101 // Use JS directly which is much faster than Element::find.
    102 // We want to close it as fast as possible, within 20ms, corresponding to
    103 // the debounce on Drupal.dialog.resetSize.
    104 $this->getSession()->executeScript('document.querySelector(".ui-dialog button[title=\"Close\"]").click();');
    105 }
    106
  • 69 93 $this->assertNotNull($close_button);
    70 94 $close_button->press();
    71 95
    96 // Test opening and immediately closing modal a few times.
    97 // Ensure no JS errors are thrown.
    98 for ($i = 0; $i < 10; $i++) {
    99 $this->getSession()->getPage()->clickLink('Link 1 (modal)');
  • 63 63 * @fires event:dialogContentResize
    64 64 */
    65 65 function resetSize(event) {
    66 // Ensure the UI dialog instance exists/is valid.
    67 if (
    68 !event.data ||
    69 !event.data.$element ||
    70 !event.data.$element.data('ui-dialog')
  • Hervé Donner added 1 commit

    added 1 commit

    Compare with previous version

  • Hervé Donner mentioned in merge request !10069

    mentioned in merge request !10069

  • Please register or sign in to reply
    Loading