Download & Extend

Draggable tables don't work without page-content class?

Project:Modal Frame API
Version:6.x-1.7
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

I noticed an odd bug today: if you have a draggable table (drupal_add_tabledrag()) open in a Modalframe dialog, the draggable table setup javascript works like it should: handles are added and everything seems to be set up correctly, but clicking on the moving handles doesn't do anything... no dragability.

It's a different bug than issue #692324: Draggable doesn't work in Safari, because it does not generate any error messages in the JavaScript console. Also, I am already using jQuery 1.3 and jQuery UI 1.7, which was the cause of the other issue.

I figured out that it wasn't working because the modalframe-page.tpl.php file did not use the "page-content" class anywhere in it's enclosing DIVs. Once I added the "page-content" class to the DIV with the "modalframe-page-content" class, it started working again! Weird huh?

Needless to say, it took a long time to figure that out. I started by realizing that turning the $GLOBALS['modalframe_page_template'] = TRUE; variable off in modalframe_child_js() caused it to work, meaning that it worked with my admin theme's page.tpl.php. So I copied my admin theme's page.tpl.php into modalframe-page.tpl.php and just started removing stuff until it stopped working. Long story short: it was the "page-content" class.

I did a bunch of file contents searching for "page-content" throughout my installation (in Drupal's core JS files, in jQuery Update's JS files, and in jQuery UI's JS files) but didn't find anything that would suggest this class is necessary.

I wonder if it has to do with the admin theme I'm using? I'm using Rubik (drupal.org/project/rubik). Rubik does do a lot of CSS stuff with the "page-content" class, but I'm not sure if that is what causes this. I haven't tried replicating this bug on a site without Rubik, so I haven't isolated that yet.

For now, I just added the "page-content" class to modalframe-page.tpl.php.

Anyone else come across this issue?

Comments

#1

Ok yea, I tested this with Garland as the admin theme, and it worked fine. So somehow Rubik breaks draggable tables in Modalframe dialogs.

nobody click here