The argument for preventing downloading
This commit is contained in:
parent
d3c0ab1e72
commit
c788e7939d
|
@ -23,7 +23,7 @@ if (typeof window.reinitializer !== "function") {
|
||||||
/**
|
/**
|
||||||
* Instance of the observer
|
* Instance of the observer
|
||||||
*/
|
*/
|
||||||
observer = new MutationObserver(() => this.handle(this.root));
|
observer = new MutationObserver(() => this.handle());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct
|
* Construct
|
||||||
|
@ -37,10 +37,12 @@ if (typeof window.reinitializer !== "function") {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reinitialize <link> and <script> elements
|
* Reinitialize <link> and <script> elements
|
||||||
|
*
|
||||||
|
* @param {bool} download Reinitialize elements with downloading or just move
|
||||||
*
|
*
|
||||||
* @return {bool} Processing status
|
* @return {bool} Processing status
|
||||||
*/
|
*/
|
||||||
handle() {
|
handle(download = true) {
|
||||||
// Check for a dublicate execute launch
|
// Check for a dublicate execute launch
|
||||||
if (this.started) return false;
|
if (this.started) return false;
|
||||||
|
|
||||||
|
@ -56,8 +58,8 @@ if (typeof window.reinitializer !== "function") {
|
||||||
// Initialization of the <link> element
|
// Initialization of the <link> element
|
||||||
const link = links[0];
|
const link = links[0];
|
||||||
|
|
||||||
if (link.getAttribute("data-reinitializer-ignore") === "true") {
|
if (download !== true || link.getAttribute("data-reinitializer-ignore") === "true") {
|
||||||
// Marked as ignored
|
// Download is disabled or marked as ignored
|
||||||
|
|
||||||
// Move element
|
// Move element
|
||||||
this.css.appendChild(link);
|
this.css.appendChild(link);
|
||||||
|
@ -124,8 +126,11 @@ if (typeof window.reinitializer !== "function") {
|
||||||
// Initialization of the <script> element
|
// Initialization of the <script> element
|
||||||
const script = scripts[0];
|
const script = scripts[0];
|
||||||
|
|
||||||
if (script.getAttribute("data-reinitializer-ignore") === "true") {
|
|
||||||
// Marked as ignored
|
console.log(download);
|
||||||
|
if (download !== true || script.getAttribute("data-reinitializer-ignore") === "true") {
|
||||||
|
// Download is disabled or marked as ignored
|
||||||
|
|
||||||
|
|
||||||
// Move element
|
// Move element
|
||||||
this.js.appendChild(script);
|
this.js.appendChild(script);
|
||||||
|
|
Loading…
Reference in New Issue