Browse Source

Fix Thumbnail API

pull/140/head
Jānis Skarnelis 4 years ago
parent
commit
bc2607e64d
  1. 2
      dist/fancybox.esm.js
  2. 2
      dist/fancybox.umd.js
  3. 38
      src/Fancybox/plugins/Thumbs/Thumbs.js

2
dist/fancybox.esm.js

File diff suppressed because one or more lines are too long

2
dist/fancybox.umd.js

File diff suppressed because one or more lines are too long

38
src/Fancybox/plugins/Thumbs/Thumbs.js

@ -157,42 +157,38 @@ export class Thumbs {
*/ */
toggle() { toggle() {
if (this.state === "visible") { if (this.state === "visible") {
this.Carousel.Panzoom.detachEvents(); this.hide();
} else if (this.state === "hidden") {
this.$container.style.display = "none"; this.show();
} else {
this.state = "hidden"; this.build();
return;
} }
}
/**
* Show thumbnail list
*/
show() {
if (this.state === "hidden") { if (this.state === "hidden") {
this.$container.style.display = ""; this.$container.style.display = "";
this.Carousel.Panzoom.attachEvents(); this.Carousel.Panzoom.attachEvents();
this.state = "visible"; this.state = "visible";
return;
} }
this.build();
}
/**
* Show thumbnail list
*/
show() {
this.state = "hidden";
this.toggle();
} }
/** /**
* Hide thumbnail list * Hide thumbnail list
*/ */
hide() { hide() {
this.state = "visible"; if (this.state === "visible") {
this.toggle(); this.Carousel.Panzoom.detachEvents();
this.$container.style.display = "none";
this.state = "hidden";
}
} }
/** /**

Loading…
Cancel
Save