From 3697ce7f9d83762c8ac015f11219b0d02f9ddf3e Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 26 Sep 2011 22:53:51 -0300 Subject: Colorbox support --- muamba.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'muamba.js') diff --git a/muamba.js b/muamba.js index e69de29..b1f9062 100644 --- a/muamba.js +++ b/muamba.js @@ -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)); -- cgit v1.2.3