comand-component-library 3.3.59 → 3.3.61
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/comand-component-library.js +26 -9
- package/dist/comand-component-library.umd.cjs +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/CmdBackToTopButton.vue +36 -11
- package/src/components/CmdCompanyLogo.vue +5 -0
- package/src/components/CmdThumbnailScroller.vue +5 -1
@@ -1604,13 +1604,18 @@ const jh = /* @__PURE__ */ N(Cs, [["render", ll]]);
|
|
1604
1604
|
const ol = {
|
1605
1605
|
name: "CmdBackToTopButton",
|
1606
1606
|
data() {
|
1607
|
+
var e;
|
1607
1608
|
return {
|
1608
1609
|
windowInnerHeight: window.innerHeight,
|
1609
|
-
windowScrollY:
|
1610
|
-
|
1610
|
+
windowScrollY: this.getScrollY(),
|
1611
|
+
scrollHeight: ((e = document.querySelector(this.scrollContainer)) == null ? void 0 : e.scrollHeight) || 0
|
1611
1612
|
};
|
1612
1613
|
},
|
1613
1614
|
props: {
|
1615
|
+
scrollContainer: {
|
1616
|
+
type: String,
|
1617
|
+
default: "body"
|
1618
|
+
},
|
1614
1619
|
iconBackToTop: {
|
1615
1620
|
type: Object,
|
1616
1621
|
default: function() {
|
@@ -1622,23 +1627,31 @@ const ol = {
|
|
1622
1627
|
}
|
1623
1628
|
}
|
1624
1629
|
},
|
1625
|
-
|
1626
|
-
|
1630
|
+
mounted() {
|
1631
|
+
var e;
|
1632
|
+
window.addEventListener("resize", this.onViewportChange), this.scrollContainer === "body" ? window.addEventListener("scroll", this.onViewportChange) : (e = document.querySelector(this.scrollContainer)) == null || e.addEventListener("scroll", this.onViewportChange);
|
1627
1633
|
},
|
1628
1634
|
unmounted() {
|
1629
|
-
|
1635
|
+
var e;
|
1636
|
+
window.removeEventListener("resize", this.onViewportChange), this.scrollContainer === "body" ? window.addEventListener("scroll", this.onViewportChange) : (e = document.querySelector(this.scrollContainer)) == null || e.removeEventListener("scroll", this.onViewportChange);
|
1630
1637
|
},
|
1631
1638
|
computed: {
|
1632
1639
|
show() {
|
1633
|
-
return this.windowScrollY > 0 && this.windowInnerHeight < this.
|
1640
|
+
return this.windowScrollY > 0 && this.windowInnerHeight < this.scrollHeight;
|
1634
1641
|
}
|
1635
1642
|
},
|
1636
1643
|
methods: {
|
1644
|
+
getScrollY() {
|
1645
|
+
var e;
|
1646
|
+
return this.scrollContainer === "body" ? window.scrollY : ((e = document.querySelector(this.scrollContainer)) == null ? void 0 : e.scrollTop) || 0;
|
1647
|
+
},
|
1637
1648
|
onViewportChange() {
|
1638
|
-
|
1649
|
+
var e;
|
1650
|
+
this.windowInnerHeight = window.innerHeight, this.windowScrollY = this.getScrollY(), this.scrollHeight = ((e = document.querySelector(this.scrollContainer)) == null ? void 0 : e.scrollHeight) || 0;
|
1639
1651
|
},
|
1640
1652
|
onBackToTop() {
|
1641
|
-
|
1653
|
+
var e;
|
1654
|
+
this.scrollContainer === "body" ? window.scrollTo({ top: 0, left: 0, behavior: "smooth" }) : (e = document.querySelector(this.scrollContainer)) == null || e.scrollTo({ top: 0, left: 0, behavior: "smooth" });
|
1642
1655
|
}
|
1643
1656
|
}
|
1644
1657
|
}, al = ["title"];
|
@@ -1942,7 +1955,11 @@ const Il = {
|
|
1942
1955
|
this.allowOpenFancyBox && Mt({ fancyBoxGallery: this.items, defaultGalleryIndex: e }), this.emitCurrentItemId(e);
|
1943
1956
|
},
|
1944
1957
|
emitCurrentItemId(e) {
|
1945
|
-
|
1958
|
+
if (this.contentType === "image") {
|
1959
|
+
this.$emit("click", this.items[e].image.id);
|
1960
|
+
return;
|
1961
|
+
}
|
1962
|
+
this.$emit("click", this.items[e].id);
|
1946
1963
|
},
|
1947
1964
|
executeLink(e, i) {
|
1948
1965
|
this.executeOnClick === "emit" ? (i.preventDefault(), this.emitCurrentItemId(e)) : this.executeOnClick === "fancybox" && (i.preventDefault(), this.showFancyBox(e));
|