I used the popups module to display the /admin/build/block page in a popup window. This scheme uses AJAX to load the page contents and integrates the page into the existing DOM. When the overlay is dismissed, the JavaScript code that is associated with the block module remains, including the Drupal behaviors. When other popup pages are viewed after this, several JavaScript errors occur due to Drupal.tableDrag or Drupal.tableDrag.row not being defined.

This patch protects the JavaScript from such an error. I have tested it on FF3, IE6, and IE7 so far.

CommentFileSizeAuthor
block_overlay.patch1.12 KBpaul.lovvik

Comments

catch’s picture

Status: Needs review » Needs work

It seems like this is going to affect any page using tabledrag.js - so we should either fix it in tabledrag.js itself, or if that's not possible, fix it across core where the same issue is likely to occur. While I'm pretty ignorant of javascript, I'm also a bit surprised it's not possible to mess with DrupalBehaviours and unbind the block tabledrag from the code adding/removing the overlay.

Minor point, ajax should be capitalised.

rfay’s picture

@paul.lovik, does this issue remain? If not, please close it. If it does, please pursue it.

paul.lovvik’s picture

Status: Needs work » Closed (fixed)

No longer an issue, closing.