Commit c63c5f9f authored by frjo's avatar frjo
Browse files

#760972: Allow any form to be opened in a Colorbox via a custom formatted link

parent f7dad21f
// $Id$
Drupal.behaviors.initColorboxForm = function (context) {
var settings = Drupal.settings.colorbox;
$.urlParam = function(name, url){
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(url);
if (!results) { return 0; }
return results[1] || 0;
};
$('.colorbox-form', context).colorbox({
innerWidth:function(){
return $.urlParam('width', $(this).attr('href'));
},
innerHeight:function(){
return $.urlParam('height', $(this).attr('href'));
},
iframe:true,
transition:settings.transition,
speed:settings.speed,
opacity:settings.opacity,
maxWidth:'100%',
maxHeight:'100%',
close:settings.close
});
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment