Browse Source

Bugfixes

pull/243/head
Jānis Skarnelis 3 years ago
parent
commit
67d31696c4
  1. 4
      src/Fancybox/plugins/Image/Image.js
  2. 11
      src/Fancybox/plugins/Toolbar/Toolbar.js
  3. 2
      src/shared/utils/PointerTracker.js

4
src/Fancybox/plugins/Image/Image.js

@ -435,8 +435,6 @@ export class Image {
const { top, left, scale, opacity } = this.getZoomInfo(slide);
slide.state = "zoomIn";
fancybox.trigger("reveal", slide);
// Scale and move to start position
@ -450,6 +448,8 @@ export class Image {
slide.$content.style.visibility = "";
slide.state = "zoomIn";
if (opacity === true) {
Panzoom.on("afterTransform", (panzoom) => {
if (slide.state === "zoomIn" || slide.state === "zoomOut") {

11
src/Fancybox/plugins/Toolbar/Toolbar.js

@ -24,11 +24,11 @@ const defaults = {
// Toolbar items; can be links, buttons or `div` elements
items: {
counter: {
position: "left",
type: "div",
class: "fancybox__counter",
html: '<span data-fancybox-index=""></span>&nbsp;/&nbsp;<span data-fancybox-count=""></span>',
tabindex: -1,
position: "left",
attr: { tabindex: -1 },
},
prev: {
type: "button",
@ -120,8 +120,7 @@ const defaults = {
label: "CLOSE",
class: "fancybox__button--close",
html: '<svg viewBox="0 0 24 24"><path d="M20 20L4 4m16 0L4 20"></path></svg>',
tabindex: 0,
attr: { "data-fancybox-close": "" },
attr: { "data-fancybox-close": "", tabindex: 0 },
},
},
};
@ -313,8 +312,8 @@ export class Toolbar {
$el.classList.add(...obj.class.split(" "));
}
for (let prop in obj.attr) {
$el.setAttribute(prop, obj[prop]);
for (const prop in obj.attr) {
$el.setAttribute(prop, obj.attr[prop]);
}
if (obj.label) {

2
src/shared/utils/PointerTracker.js

@ -2,8 +2,6 @@ import { clearTextSelection } from "./clearTextSelection.js";
class Pointer {
constructor(nativePointer) {
this.id = -1;
this.id = nativePointer.pointerId || nativePointer.identifier || -1;
this.pageX = nativePointer.pageX;

Loading…
Cancel
Save