Needs work
Project:
Ajax
Version:
6.x-1.14
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 Dec 2011 at 21:34 UTC
Updated:
21 Jan 2012 at 08:30 UTC
So I've been trying to get the code below to work with your callback function to avail for Facebox modals with a form. Please advise.
I'm trying to get the user login to work within the facebox modal. On the actual user/login page, it works just fine. Facebox can be downloaded off of http://defunkt.io/facebox/
Drupal.Ajax.plugins.facebox = function(hook, args) {
if (hook === 'faceboxOpen') {
var targetelement = $('#facebox');
Drupal.attachBehaviors(targetelement);
}
// Also tried following the thickbox convention (this is commented out)
/*if (hook === 'faceboxOpen') {
if (args === '#facebox') {
//alert(args);
return false;
}
else {
return true;
}
}
if (hook === 'init') {
$('a.facebox-login').mousedown(function () {
Drupal.attachBehaviors($('#facebox'));
//alert('attach active');
});
}*/
return true;
}In my theme scripts file, I've also run this when the modal link is clicked (the link that pops up the modal). To change the hook value to say the modal is now up.
$('a.facebox', context).mousedown(function () {
Drupal.Ajax.plugins.facebox('faceboxOpen', '#facebox');
});Part of this may be wrong...but I've been trying to do millions of variations of your code for the past few hours and it just won't work.
Comments
Comment #1
brendoncrawford commented