Download & Extend

Lazy-loading of css stylesheet and js scripts

Project:Dialog API
Version:6.x-1.x-dev
Component:User interface
Category:task
Priority:normal
Assigned:maykbrito
Status:needs work

Issue Summary

Other issue.. fieldset does not open
Rob Loach already found some solution but needs work (I guess)

Solution: http://zroger.com/node/31#comment-234

Thanks everyone..
again GREAT MODULE

Comments

#1

I found a solution (for while)..
open dialog.module and add this line (about line 22):

drupal_add_js('misc/collapse.js');

worked for me.. but of course.. better way is better!! =]

what you think? it's a good or bad choice ?

#2

Status:active» needs work

This patch adds the xLazyLoader. Not sure where we should use it so far though, but it does provide the command, so you could tell the client to load collapse.js. You can see it in action on the Drupal 7 branch:
http://head.robloach.net/dialog/example

When you click on one of the contextual links (like configure block), it loads up the additional JavaScript so that the vertical tabs work.

AttachmentSize
lazy.patch 10.81 KB

#3

What do you do to your dialog box auto-resize? Over here I put those blog_node_form and it's not work (auto-resizing) and not scrolling either.

#4

Title:Fieldset is not opening» Lazy-loading of css stylesheet and js scripts

In order for forms to work in a Dialog we need it to be able to lazy-load both css and js files.
Would it make sense to provide a function to automatically load css and js files required by forms (through a function), if you specify the Dialog is opening a form?

#5

#6

I'm wondering if the lazyloader should be removed from the module now that the ajax system handles it. It seems to be double-loading css and js that's already on the page. :(

#7

Do it! ;-)