mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Remove variable shadowing from the JavaScript files in the web/
folder
*This is part of a series of patches that will try to split PR 11566 into smaller chunks, to make reviewing more feasible.* Once all the code has been fixed, we'll be able to eventually enable the ESLint `no-shadow` rule; see https://eslint.org/docs/rules/no-shadow
This commit is contained in:
parent
a23ce6b483
commit
886b256ada
6 changed files with 25 additions and 30 deletions
|
@ -109,7 +109,7 @@ var FontInspector = (function FontInspectorClosure() {
|
|||
return moreInfo;
|
||||
}
|
||||
var moreInfo = properties(fontObj, ["name", "type"]);
|
||||
var fontName = fontObj.loadedName;
|
||||
const fontName = fontObj.loadedName;
|
||||
var font = document.createElement("div");
|
||||
var name = document.createElement("span");
|
||||
name.textContent = fontName;
|
||||
|
@ -130,17 +130,12 @@ var FontInspector = (function FontInspectorClosure() {
|
|||
event.preventDefault();
|
||||
console.log(fontObj);
|
||||
});
|
||||
var select = document.createElement("input");
|
||||
const select = document.createElement("input");
|
||||
select.setAttribute("type", "checkbox");
|
||||
select.dataset.fontName = fontName;
|
||||
select.addEventListener(
|
||||
"click",
|
||||
(function(select, fontName) {
|
||||
return function() {
|
||||
selectFont(fontName, select.checked);
|
||||
};
|
||||
})(select, fontName)
|
||||
);
|
||||
select.addEventListener("click", function() {
|
||||
selectFont(fontName, select.checked);
|
||||
});
|
||||
font.appendChild(select);
|
||||
font.appendChild(name);
|
||||
font.appendChild(document.createTextNode(" "));
|
||||
|
@ -476,7 +471,7 @@ var Stats = (function Stats() {
|
|||
}
|
||||
var statsIndex = getStatIndex(pageNumber);
|
||||
if (statsIndex !== false) {
|
||||
var b = stats[statsIndex];
|
||||
const b = stats[statsIndex];
|
||||
this.panel.removeChild(b.div);
|
||||
stats.splice(statsIndex, 1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue