Fixing unused functions and params
This commit is contained in:
parent
ca0f9f4e59
commit
f87f6c75f5
|
@ -29,6 +29,8 @@
|
|||
"brace-style": ["warn", "allman", {"allowSingleLine": true}],
|
||||
"function-call-argument-newline" : ["warn", "consistent"],
|
||||
"function-paren-newline": ["warn", "consistent"],
|
||||
"no-magic-numbers": ["error", {"ignore": [0,1,2,100]}]
|
||||
"no-magic-numbers": ["error", {"ignore": [0,1,2,100]}],
|
||||
"quote-props": ["warn", "as-needed"],
|
||||
"no-unused-vars": ["error", {"argsIgnorePattern": "^_"}]
|
||||
}
|
||||
}
|
||||
|
|
37
melpomene.js
37
melpomene.js
|
@ -135,26 +135,6 @@ function getFirstZoomOfPage(pageNumber)
|
|||
}
|
||||
}
|
||||
|
||||
function getLastZoomOfPage(pageNumber)
|
||||
{
|
||||
let res = null;
|
||||
|
||||
for (let zoomIdx = 0; zoomIdx < PAGES_ZOOMS.length; zoomIdx += 1)
|
||||
{
|
||||
if (PAGES_ZOOMS[zoomIdx][0] === pageNumber)
|
||||
{
|
||||
res = zoomIdx;
|
||||
}
|
||||
|
||||
if (res !== null && PAGES_ZOOMS[zoomIdx][0] !== pageNumber)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
function getZoomCountForPage(pageNumber)
|
||||
{
|
||||
return PAGES_ZOOMS.filter(zoom => zoom[0] === pageNumber).length;
|
||||
|
@ -210,11 +190,6 @@ function readerFrameRatio()
|
|||
return READER_CONTENT_FRAME.clientWidth / READER_CONTENT_FRAME.clientHeight;
|
||||
}
|
||||
|
||||
function pageRatio(pageNumber)
|
||||
{
|
||||
return READER_PAGES.children[pageNumber - 1].naturalWidth / READER_PAGES.children[pageNumber - 1].naturalHeight;
|
||||
}
|
||||
|
||||
function pageMaxHeight()
|
||||
{
|
||||
let maxHeight = 0;
|
||||
|
@ -262,7 +237,7 @@ function initReader()
|
|||
|
||||
// Smoothly show pictures when they intersect with the viewport
|
||||
const visibilityObserver = new IntersectionObserver(
|
||||
(entries, observer) =>
|
||||
(entries, _observer) =>
|
||||
{
|
||||
entries.forEach((entry) =>
|
||||
{
|
||||
|
@ -593,24 +568,24 @@ function handleMouseWhell(event)
|
|||
|
||||
window.addEventListener(
|
||||
"load",
|
||||
(event) => { initReader() }
|
||||
(_event) => { initReader(); }
|
||||
);
|
||||
|
||||
addEventListener(
|
||||
"resize",
|
||||
(event) => { refreshReaderDisplay() }
|
||||
(_event) => { refreshReaderDisplay(); }
|
||||
);
|
||||
|
||||
addEventListener(
|
||||
"keydown",
|
||||
(event) =>
|
||||
{
|
||||
handleKeyPress(event.key, event.shiftKey)
|
||||
handleKeyPress(event.key, event.shiftKey);
|
||||
}
|
||||
);
|
||||
|
||||
addEventListener(
|
||||
"wheel",
|
||||
(event) => { handleMouseWhell(event) },
|
||||
{ passive:false }
|
||||
(event) => { handleMouseWhell(event); },
|
||||
{ passive: false }
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue