Commit 68d76434 authored by frjo's avatar frjo
Browse files

Issue #1933956 by frjo | davidd07: Behaviors Attach and cbox_complete.

parent b8537230
......@@ -17,13 +17,11 @@ Drupal.behaviors.initColorbox = {
$('.colorbox', context)
.once('init-colorbox')
.colorbox(settings.colorbox);
$(context).bind('cbox_complete', function () {
Drupal.attachBehaviors('#cboxLoadedContent');
});
}
};
{
$(document).bind('cbox_complete', function () {
Drupal.attachBehaviors('#cboxLoadedContent');
});
}
})(jQuery);
......@@ -2,7 +2,7 @@
Drupal.behaviors.initColorboxDefaultStyle = {
attach: function (context, settings) {
$(document).bind('cbox_complete', function () {
$(context).bind('cbox_complete', function () {
// Only run if there is a title.
if ($('#cboxTitle:empty', context).length == false) {
$('#cboxLoadedContent img', context).bind('mouseover', function () {
......
......@@ -2,7 +2,7 @@
Drupal.behaviors.initColorboxPlainStyle = {
attach: function (context, settings) {
$(document).bind('cbox_complete', function () {
$(context).bind('cbox_complete', function () {
// Make all the controls invisible.
$('#cboxCurrent, #cboxSlideshow, #cboxPrevious, #cboxNext', context).addClass('element-invisible');
// Replace "Close" with "×" and show.
......@@ -24,7 +24,7 @@ Drupal.behaviors.initColorboxPlainStyle = {
}
});
});
$(document).bind('cbox_closed', function () {
$(context).bind('cbox_closed', function () {
$('#cboxClose', context).removeClass('cbox-close-plain');
});
}
......
......@@ -2,15 +2,15 @@
Drupal.behaviors.initColorboxStockholmsyndromeStyle = {
attach: function (context, settings) {
$(document).bind('cbox_open', function () {
$(context).bind('cbox_open', function () {
// Hide close button initially.
$('#cboxClose', context).css('opacity', 0);
});
$(document).bind('cbox_load', function () {
$(context).bind('cbox_load', function () {
// Hide close button. (It doesn't handle the load animation well.)
$('#cboxClose', context).css('opacity', 0);
});
$(document).bind('cbox_complete', function () {
$(context).bind('cbox_complete', function () {
// Show close button with a delay.
$('#cboxClose', context).fadeTo('fast', 0, function () {$(this).css('opacity', 1)});
});
......
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