Browse Source

Execute <script> elements within HTML content

pull/140/head
Jānis Skarnelis 3 years ago
parent
commit
f0b7ce9b0b
  1. 2
      dist/fancybox.esm.js
  2. 2
      dist/fancybox.umd.js
  3. 14
      src/Fancybox/Fancybox.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

14
src/Fancybox/Fancybox.js

@ -825,8 +825,10 @@ class Fancybox extends Base {
$content = html;
}
} else {
const $fragment = document.createRange().createContextualFragment(html);
$content = document.createElement("div");
$content.innerHTML = html;
$content.appendChild($fragment);
}
if (!($content instanceof Element)) {
@ -852,7 +854,15 @@ class Fancybox extends Base {
slide.$content = $content;
$el.prepend($content);
// console.log(`---`);
// console.log($el);
// console.log($content);
// const frag = document.createRange().createContextualFragment(html);
// document.body.appendChild( frag );
$el.appendChild($content);
// $el.appendChild(frag);
this.manageCloseButton(slide);

Loading…
Cancel
Save