Needs work
Project:
Popups API (Ajax Dialogs) [D7]
Version:
6.x-2.0-beta0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
2 Jun 2011 at 14:30 UTC
Updated:
4 Dec 2011 at 22:15 UTC
In case a form in a popup is reloaded (not done yet), extra javascript is not loaded.
In "popups.js" file I added the following lines, in the function "Popups.formSuccess":
if (!done) { // Not done yet, so show new page in new popups.
Popups.removeLoading();
Popups.openPathContent(data.path, data.title, data.messages + data.content, popup.element, popup.options, popup.parent);
//PATCH 02/06/2011 - Inline JS not being loaded in case of form fail
var inlines = Popups.addJS(data.js);
Popups.addInlineJS(inlines);
Comments
Comment #1
drewish commentedI'm not quite clear what you're changing. Would you mind providing a patch to highlight the differences?
Comment #2
tugis commentedBasically I'm adding these two lines:
to the function I mentioned above. Those are the lines needed to load the JS into the popup. I'm sorry but I'm not used to create patch files. I have to learn that some day :/
Comment #3
mattcasey commentedI needed this, thanks! I am using a 'donePath' to get Popups to work with Contact Importer and Invite. I am using the hook_popups() function:
Comment #4
vivek.saurabh commentedThat's really good, but how can I add the theme's JS to popup window, because I am loading a whole form in the pop-up but the JS is not getting into.
Comment #5
mattcasey commentedvivek, how are you adding your JS? I use drupal_add_js() In my theme's template.php, and it also may help to declare your code with Drupal's Behaviors if you are not already.
Comment #6
vivek.saurabh commentedHi mattwad,
Thanks for your response, I switched my self to modalframe module and that worked like a charm.
I figured out that the, problem is with the CSS but not sure what exactly is the problem.
My requirement is to load the whole content of a form (a multi-step form) in a pop and that is achieved by the modal frame window.