Browse Source

Fix #322 - close modal if text is selected

pull/188/merge
Jānis Skarnelis 2 years ago
parent
commit
1e1148b315
  1. 2
      dist/carousel.esm.js
  2. 2
      dist/carousel.umd.js
  3. 2
      dist/fancybox.esm.js
  4. 2
      dist/fancybox.umd.js
  5. 2
      dist/panzoom.esm.js
  6. 2
      dist/panzoom.umd.js
  7. 7
      src/Panzoom/Panzoom.js

2
dist/carousel.esm.js

File diff suppressed because one or more lines are too long

2
dist/carousel.umd.js

File diff suppressed because one or more lines are too long

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

2
dist/panzoom.esm.js

File diff suppressed because one or more lines are too long

2
dist/panzoom.umd.js

File diff suppressed because one or more lines are too long

7
src/Panzoom/Panzoom.js

@ -230,10 +230,15 @@ export class Panzoom extends Base {
}
// Skip if text is selected
if (this.option("textSelection") && window.getSelection().toString().length) {
if (
this.option("textSelection") &&
window.getSelection().toString().length &&
!(event.target && event.target.hasAttribute("data-fancybox-close"))
) {
event.stopPropagation();
return;
}
// console.log(`onClickonClickonClickonClick#2`);
const rect = this.$content.getClientRects()[0];

Loading…
Cancel
Save