@@ -190,7 +190,7 @@ $(function () {
190
190
// Function to handle link clicks
191
191
function handleNavLinkClick ( event ) {
192
192
if ( ! event . shiftKey && ! event . ctrlKey && ! event . altKey && ! event . metaKey ) {
193
-
193
+ var updated = false ;
194
194
// Get the relative URL value and update the browser URL
195
195
// Use originalTarget or explicitTarget to get the correct one even for clicks from the tooltips
196
196
var anchorElement = event . originalTarget . closest ( 'a' ) ;
@@ -201,25 +201,25 @@ $(function () {
201
201
// Try to load into the inner content frame only if the collection has not changed
202
202
// Otherwise let the original click flow take effect, as the nav bar must be reloaded too
203
203
// for a different collection
204
- if ( sameCollection ( url , window . location ) ) {
204
+ if ( url . origin == window . location . origin && sameCollection ( url , window . location ) ) {
205
205
// Prevent default navigation behavior, we will use our content load method
206
206
event . preventDefault ( ) ;
207
207
208
208
var urlStr = url . pathname + url . hash ;
209
- var changed = ( urlStr != window . location . pathname + window . location . hash ) ;
209
+ updated = ( urlStr != window . location . pathname + window . location . hash ) ;
210
210
211
211
// Update the browser URL
212
212
history . pushState ( null , null , url ) ;
213
213
214
214
// Load content based on the updated relative URL
215
215
// but only if the url has changed
216
- if ( changed )
216
+ if ( updated )
217
217
updateContentFromUrl ( url ) ;
218
218
}
219
219
// Clear focus from the clicked element, as we have other visualization for the selected items
220
220
event . target . blur ( ) ;
221
221
}
222
- else
222
+ if ( false == updated )
223
223
console . debug ( "Different collection item requested, loading full page..." )
224
224
}
225
225
}
@@ -342,7 +342,7 @@ $(function () {
342
342
var hideTimeoutFuncID ;
343
343
344
344
function getTooltipPos ( event , tooltipTarget ) {
345
- const mouseX = event . clientX ;
345
+ const mouseX = event . clientX ;
346
346
const rect = tooltipTarget . getBoundingClientRect ( ) ;
347
347
var computedStyle = window . getComputedStyle ( tooltipTarget ) ;
348
348
var lineHeight = parseFloat ( computedStyle . getPropertyValue ( 'line-height' ) ) ;
@@ -361,13 +361,13 @@ $(function () {
361
361
var newPosition = position + 'px' ;
362
362
tooltip . style . setProperty ( posName , newPosition ) ;
363
363
}
364
-
364
+
365
365
function showTooltip ( event , tooltipText ) {
366
366
tooltip . innerHTML = tooltipText . innerHTML ;
367
367
368
368
var tooltipPos = getTooltipPos ( event , tooltipTarget )
369
369
var tooltipArrowLeftShift = 2 * toolTipArrowSize ;
370
-
370
+
371
371
setArrowPosition ( '--tooltip-arrow-top' , - 1 * toolTipArrowSize ) ;
372
372
setArrowPosition ( '--tooltip-arrow-left' , tooltipArrowLeftShift + toolTipArrowSize / 2 ) ;
373
373
@@ -393,14 +393,14 @@ $(function () {
393
393
function shouldHideTooltip ( activeTarget ) {
394
394
return ( ( tooltipTarget == null || activeTarget != tooltipTarget ) && ( tooltip == null || ( activeTarget != tooltip && activeTarget . closest ( '.tooltip' ) == null ) ) ) ;
395
395
}
396
-
396
+
397
397
function hideTooltip ( withDelay ) {
398
398
function doHideTooltip ( ) {
399
399
if ( false == shouldShowTooltip && tooltip )
400
400
tooltip . classList . remove ( 'visible' ) ;
401
401
tooltipTarget = null ;
402
402
}
403
-
403
+
404
404
shouldShowTooltip = false ;
405
405
406
406
if ( withDelay ) {
0 commit comments