chart2music
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -178,3 +178,2 @@ var c2mChart = (function (exports) { | ||
this._numPaddingCharacters = 0; | ||
this._elementsToDelete = []; | ||
this._element = captionElement; | ||
@@ -200,9 +199,6 @@ this._lastCreatedElement = null; | ||
divElement.setAttribute(ScreenReaderBridge.ORIGINAL_TEXT_ATTRIBUTE, text); | ||
divElement.setAttribute("data-created", Date.now().toString()); | ||
if (this.lastCreatedElement) { | ||
this._removeOldElements(); | ||
this.lastCreatedElement.style.display = "none"; | ||
this._elementsToDelete.push({ | ||
element: this.lastCreatedElement, | ||
time: Date.now() | ||
}); | ||
} | ||
@@ -223,12 +219,8 @@ this._element.appendChild(divElement); | ||
const curTime = Date.now(); | ||
const elementsTooYoungToDelete = []; | ||
this._elementsToDelete.forEach((eInfo) => { | ||
if (curTime - eInfo.time > ScreenReaderBridge.REMOVAL_DELAY) { | ||
this._element.removeChild(eInfo.element); | ||
Array.from(this._element.children).forEach((kid) => { | ||
const time = Number(kid.getAttribute("data-time")); | ||
if (curTime - time > ScreenReaderBridge.REMOVAL_DELAY) { | ||
this._element.removeChild(kid); | ||
} | ||
else { | ||
elementsTooYoungToDelete.push(eInfo); | ||
} | ||
}); | ||
this._elementsToDelete = elementsTooYoungToDelete; | ||
} | ||
@@ -235,0 +227,0 @@ } |
{ | ||
"name": "chart2music", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/index.mjs", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
129270
28
3129