diff options
Diffstat (limited to 'muamba.js')
-rw-r--r-- | muamba.js | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,20 @@ +(function ($) { + + Drupal.behaviors.muamba = { + attach: function (context, settings) { + // Ajax colorbox support + // See https://drupal.org/node/836160#comment-4870846 + $('.colorbox-ajax', context).each( function() { + // get the current URL + var oldUrl = $(this).attr('href'); + // append the required parameters + // TODO: there might be already a ? at the url, + // in that case use & instead + var newUrl = oldUrl + '?template=colorbox'; + // update the links href + $(this).attr('href', newUrl); + }); + } + }; + +}(jQuery)); |