Added tests for jQuery.

This commit is contained in:
2019-07-16 10:04:25 +02:00
parent 09b50d3b81
commit 1f5df65c48
3 changed files with 33 additions and 25 deletions
+15 -11
View File
@@ -9328,7 +9328,9 @@
}
//jquery hyphenate below
$('.column').not('.overview').children('p').hyphenate('de');
if (typeof($) != 'undefined') {
$('.column').not('.overview').children('p').hyphenate('de');
}
//logging
if (src) {
@@ -9764,7 +9766,7 @@
let linkRects = links.map(link => {
let rect = link.getBoundingClientRect();
let topLeft = Points.fromPageToNode(indexbox, rect);
let center = Points.fromPageToNode(indexbox, {x: rect.x + rect.width/2, y: rect.y + rect.height/2});
let center = Points.fromPageToNode(indexbox, { x: rect.x + rect.width / 2, y: rect.y + rect.height / 2 });
return { x: topLeft.x, y: topLeft.y, width: rect.width, height: rect.height, center, link }
});
@@ -9791,7 +9793,7 @@
let local = Points.fromPageToNode(context, globalClick);
let rect = linkRects[closestLinkIndex];
local.y = rect.center.y;
Card.loadPopup(event, context, closestLink, local);
}
}
@@ -9820,8 +9822,10 @@
this._setPopupSource(popup, source);
context.popup = popup;
//jquery hyphenate below
console.log('hyphenated popup:', $('span').hyphenate('de'));
if (typeof($) != 'undefined') {
//jquery hyphenate below
console.log('hyphenated popup:', $('span').hyphenate('de'));
}
}
static _unsetPopup(context) {
@@ -9944,10 +9948,6 @@
zoomable: 0.5
};
/** Make the class available in the global namespace */
window.Card = Card;
/**
* Extends the card with scatter functionality.
*
@@ -10053,13 +10053,16 @@
*/
static loadAndCreateScatterCard(scatterContainer, item, {
basePath = "../",
modules = null,
modules = [],
onClose = null
} = {}) {
console.log(basePath);
return new Promise((resolve, reject) => {
this.loadHTML(basePath + "/" + item + "/index.html")
let url = basePath + "/" + item + "/index.html";
console.log("Loading", url);
this.loadHTML(url)
.then(html => {
console.log("Received", html);
let element = this.createCardScatter(html, scatterContainer, {
basePath,
modules
@@ -10205,6 +10208,7 @@
window.CardWrapper = CardWrapper;
window.Card = Card;
window.ScatterCard = ScatterCard;
window.Highlight = Highlight$1;
window.Theme = Theme;