diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-09-26 22:53:51 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-09-26 22:53:51 -0300 |
commit | 3697ce7f9d83762c8ac015f11219b0d02f9ddf3e (patch) | |
tree | b7b1a0b4f690f5936d18cdc7e5b17005384f1d1b /muamba.js | |
parent | 7bdf5f7a1e9fcdf1888f42ef8e7e92a7bc472fa6 (diff) | |
download | muamba-3697ce7f9d83762c8ac015f11219b0d02f9ddf3e.tar.gz muamba-3697ce7f9d83762c8ac015f11219b0d02f9ddf3e.tar.bz2 |
Colorbox support
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)); |