@glomex/glomex-dialog
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -759,4 +759,2 @@ import { RotataToFullscreen } from './rotate-to-fullscreen.js'; | ||
if (name === 'dock-sticky-target-top') { | ||
this.shadowRoot.querySelector('.dock-sticky-target') | ||
.style.top = `${newValue || 0}px`; | ||
this.refreshDockDialog(); | ||
@@ -840,2 +838,3 @@ } | ||
const dockStickyTarget = this.shadowRoot.querySelector('.dock-sticky-target'); | ||
const dockStickyTargetTop = this.getAttribute('dock-sticky-target-top'); | ||
const clientRect = this.getBoundingClientRect(); | ||
@@ -850,6 +849,6 @@ const mode = this.getAttribute('mode'); | ||
]; | ||
// adjust the ".dock-sticky-target" top value based on selector | ||
if (dockMode === 'sticky') { | ||
const alternativeDockTarget = getAlternativeDockTarget(this); | ||
if (alternativeDockTarget) { | ||
// adjust the ".dock-sticky-target" top value based on selector | ||
const { height } = getViewportIntersection(alternativeDockTarget); | ||
@@ -859,7 +858,11 @@ // in case we attach to navigation bars that can be expanded | ||
// based on given external selector | ||
if (height < STICKY_TOP_SELECTOR_THRESHOLD) { | ||
// add 5px to have some distance from the top | ||
const adjustedHeight = height + 5; | ||
dockStickyTarget.style.top = `${adjustedHeight || 0}px`; | ||
if (height < STICKY_TOP_SELECTOR_THRESHOLD && height > 0) { | ||
dockStickyTarget.style.top = `${height || 0}px`; | ||
} else { | ||
// when not visible adjust to dock-sticky-target-top value | ||
dockStickyTarget.style.top = `${dockStickyTargetTop || 0}px`; | ||
} | ||
} else { | ||
// when no alternative dock target adjust to dock-sticky-target-top value | ||
dockStickyTarget.style.top = `${dockStickyTargetTop || 0}px`; | ||
} | ||
@@ -866,0 +869,0 @@ } |
{ | ||
"name": "@glomex/glomex-dialog", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "A dialog web component that allows docking a video player or putting it in a lightbox", | ||
@@ -5,0 +5,0 @@ "type": "module", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
121808
1217