aboutsummaryrefslogtreecommitdiff
path: root/muamba.js
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-09-26 22:53:51 -0300
committerSilvio Rhatto <rhatto@riseup.net>2011-09-26 22:53:51 -0300
commit3697ce7f9d83762c8ac015f11219b0d02f9ddf3e (patch)
treeb7b1a0b4f690f5936d18cdc7e5b17005384f1d1b /muamba.js
parent7bdf5f7a1e9fcdf1888f42ef8e7e92a7bc472fa6 (diff)
downloadmuamba-3697ce7f9d83762c8ac015f11219b0d02f9ddf3e.tar.gz
muamba-3697ce7f9d83762c8ac015f11219b0d02f9ddf3e.tar.bz2
Colorbox support
Diffstat (limited to 'muamba.js')
-rw-r--r--muamba.js20
1 files changed, 20 insertions, 0 deletions
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));