Problem/Motivation

I noticed this problem first with Views.

Steps to reproduce

  1. Open the default content View.
  2. Click the Add field button.
  3. Pick a field from the checkbox list.
  4. Click the apply button. The dialog refreshes with a the second step in a multiform.
  5. Resize the window.
  6. A JavaScript error is thrown.

I believe this has to do with the way we're debouncing the resize function in dialog.position.js. The eventData params associated with the event handler are not getting passed through to the handler function after the dialog is re-opened on when it refreshes with the new form. If I take the debounce off the handler, the error disappears. I'm investigating how we can debounce the function and not raise an error.

Proposed resolution

Fix it.

Remaining tasks

Fix it.

User interface changes

None.

API changes

None.

#1851414: Convert Views to use the abstracted dialog modal

Original report by @jessebeach

CommentFileSizeAuthor
#1 2114475-1-dialog-resize-error.patch4.07 KBjessebeach
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jessebeach’s picture

Status: Active » Needs review
FileSize
4.07 KB

Rather than using jQuery's event data, I've curried the event data to the resize function and then debounced that. This keeps the data associated with the callback correctly.

Also, we weren't removing the drupalViewportOffsetChange event handler on the document when tearing down the dialog. This caused an error when this event fired.

Since Views will create a new dialog without tearing down the old one in a multistep form, I've removed the event handlers in the dialog:aftercreate callback on the window and document before binding new ones.

Wim Leers’s picture

I cannot reproduce the original problem. Which browser did that happen in?

jessebeach’s picture

Issue summary: View changes
Status: Needs review » Closed (cannot reproduce)

I can no longer reproduce this error either. I'm closing as cannot reproduce.