updated etxlink, ctools, colorbox, computed_field

This commit is contained in:
2019-05-13 17:51:14 +02:00
parent 33210e10f2
commit 2ffad14939
309 changed files with 4930 additions and 2655 deletions

View File

@@ -268,7 +268,7 @@
// We also have to check jQuery version to prevent
// IE8 + jQuery 1.4.4 to break on other events
// bound to the submit button.
if (jQuery.fn.jquery === '1.4' && typeof event.bubbles === "undefined") {
if (jQuery.fn.jquery.substr(0, 3) === '1.4' && typeof event.bubbles === "undefined") {
$(this.form).trigger('submit');
return false;
}
@@ -302,7 +302,7 @@
// Attach behaviors within a modal dialog.
var settings = response.settings || ajax.settings || Drupal.settings;
Drupal.attachBehaviors('#modalContent', settings);
Drupal.attachBehaviors($('#modalContent'), settings);
if ($('#modal-content').hasClass('ctools-modal-loading')) {
$('#modal-content').removeClass('ctools-modal-loading');
@@ -378,7 +378,7 @@
}
}
if (!speed) {
if (!speed && 0 !== speed) {
speed = 'fast';
}
@@ -554,14 +554,15 @@
// Create our content div, get the dimensions, and hide it
var modalContent = $('#modalContent').css('top','-1000px');
var mdcTop = wt + ( winHeight / 2 ) - ( modalContent.outerHeight() / 2);
var $modalHeader = modalContent.find('.modal-header');
var mdcTop = wt + Math.max((winHeight / 2) - (modalContent.outerHeight() / 2), 0);
var mdcLeft = ( winWidth / 2 ) - ( modalContent.outerWidth() / 2);
$('#modalBackdrop').css(css).css('top', 0).css('height', docHeight + 'px').css('width', docWidth + 'px').show();
modalContent.css({top: mdcTop + 'px', left: mdcLeft + 'px'}).hide()[animation](speed);
// Bind a click for closing the modalContent
modalContentClose = function(){close(); return false;};
$('.close').bind('click', modalContentClose);
$('.close', $modalHeader).bind('click', modalContentClose);
// Bind a keypress on escape for closing the modalContent
modalEventEscapeCloseHandler = function(event) {
@@ -577,7 +578,7 @@
// close button, but we should save the original focus to restore it after
// the dialog is closed.
var oldFocus = document.activeElement;
$('.close').focus();
$('.close', $modalHeader).focus();
// Close the open modal content and backdrop
function close() {
@@ -586,36 +587,44 @@
$('body').unbind( 'focus', modalEventHandler);
$('body').unbind( 'keypress', modalEventHandler );
$('body').unbind( 'keydown', modalTabTrapHandler );
$('.close').unbind('click', modalContentClose);
$('body').unbind('keypress', modalEventEscapeCloseHandler);
$('.close', $modalHeader).unbind('click', modalContentClose);
$(document).unbind('keydown', modalEventEscapeCloseHandler);
$(document).trigger('CToolsDetachBehaviors', $('#modalContent'));
// Set our animation parameters and use them
if ( animation == 'fadeIn' ) animation = 'fadeOut';
if ( animation == 'slideDown' ) animation = 'slideUp';
if ( animation == 'show' ) animation = 'hide';
// Closing animation.
switch (animation) {
case 'fadeIn':
modalContent.fadeOut(speed, modalContentRemove);
break;
// Close the content
modalContent.hide()[animation](speed);
case 'slideDown':
modalContent.slideUp(speed, modalContentRemove);
break;
// Remove the content
case 'show':
modalContent.hide(speed, modalContentRemove);
break;
}
}
// Remove the content.
modalContentRemove = function () {
$('#modalContent').remove();
$('#modalBackdrop').remove();
// Restore focus to where it was before opening the dialog
// Restore focus to where it was before opening the dialog.
$(oldFocus).focus();
};
// Move and resize the modalBackdrop and modalContent on window resize.
modalContentResize = function(){
modalContentResize = function () {
// Reset the backdrop height/width to get accurate document size.
$('#modalBackdrop').css('height', '').css('width', '');
// Position code lifted from:
// http://www.quirksmode.org/viewport/compatibility.html
if (self.pageYOffset) { // all except Explorer
var wt = self.pageYOffset;
var wt = self.pageYOffset;
} else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
var wt = document.documentElement.scrollTop;
} else if (document.body) { // all other Explorers
@@ -631,7 +640,7 @@
// Get where we should move content to
var modalContent = $('#modalContent');
var mdcTop = wt + ( winHeight / 2 ) - ( modalContent.outerHeight() / 2);
var mdcTop = wt + Math.max((winHeight / 2) - (modalContent.outerHeight() / 2), 0);
var mdcLeft = ( winWidth / 2 ) - ( modalContent.outerWidth() / 2);
// Apply the changes
@@ -662,9 +671,11 @@
$('body').unbind('focus', modalEventHandler);
$('body').unbind('keypress', modalEventHandler);
$('body').unbind( 'keydown', modalTabTrapHandler );
$('.close').unbind('click', modalContentClose);
var $modalContent = $('#modalContent');
var $modalHeader = $modalContent.find('.modal-header');
$('.close', $modalHeader).unbind('click', modalContentClose);
$('body').unbind('keypress', modalEventEscapeCloseHandler);
$(document).trigger('CToolsDetachBehaviors', $('#modalContent'));
$(document).trigger('CToolsDetachBehaviors', $modalContent);
// jQuery magic loop through the instances and run the animations or removal.
content.each(function(){