Commit 5cfb853b authored by frjo's avatar frjo
Browse files

Adding in context to selectors and adding initColorbox-processed/initColorboxForm-processed classes

parent c63c5f9f
// $Id$
Drupal.behaviors.initColorbox = function (context) {
var settings = Drupal.settings.colorbox;
$('.colorbox').colorbox({
$('.colorbox', context).filter(':not(.initColorbox-processed)').addClass('initColorbox-processed').colorbox({
transition:settings.transition,
speed:settings.speed,
opacity:settings.opacity,
......
// $Id$
Drupal.behaviors.initColorboxAdminSettings = function (context) {
$('div.colorbox-custom-settings-activate input.form-radio').click(function () {
$('div.colorbox-custom-settings-activate input.form-radio', context).click(function () {
if (this.value == 1) {
$('div.colorbox-custom-settings').show();
}
......
......@@ -6,7 +6,7 @@ Drupal.behaviors.initColorboxForm = function (context) {
if (!results) { return 0; }
return results[1] || 0;
};
$('.colorbox-form', context).colorbox({
$('.colorbox-form', context).filter(':not(.initColorboxForm-processed)').addClass('initColorboxForm-processed').colorbox({
innerWidth:function(){
return $.urlParam('width', $(this).attr('href'));
},
......
// $Id$
Drupal.behaviors.initColorboxImageModule = function (context) {
// Image Attach Functionality
$('.image-attach-body > a').each(function (i) {
$('.image-attach-body > a', context).each(function (i) {
// Modify link to jpg
this.href = $('.image-attach-body > a > img:eq('+i+')').attr("src").replace(".thumbnail", "");
// Add rel tag to group
this.rel = "image-gallery";
// Colorbox it
});
$("a[rel='image-gallery']").colorbox();
$("a[rel='image-gallery']", context).colorbox();
};
// $Id$
Drupal.behaviors.initColorboxLogin = function (context) {
$("a[href*='/user/login'], a[href*='?q=user/login']").colorbox({iframe:true, innerWidth:250, innerHeight:230}).each(function() {
$("a[href*='/user/login'], a[href*='?q=user/login']", context).colorbox({iframe:true, innerWidth:250, innerHeight:230}).each(function() {
this.href = this.href.replace(/user\/login/,"user/login/colorbox");
});
};
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