mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 06:38:07 +02:00
[api-minor] Further modernize the ProgressBar
class (PR 14918 follow-up)
- Simplify how we look-up the DOM-element, which should also be a tiny bit more efficent. - Use private class-fields, rather than property-names prefixed with underscores. - Inline the `#updateBar` helper-method directly in the `percent`-setter, since having a separate method doesn't seem necessary in this case. - Set the `indeterminate`-class on the ProgressBar DOM-element, to simplify the code. Finally, also (slightly) re-factors the `PDFViewerApplication.progress`-method to make it a bit smaller.
This commit is contained in:
parent
13c01b6d4a
commit
d9ce17642f
5 changed files with 56 additions and 58 deletions
|
@ -221,13 +221,13 @@ canvas {
|
|||
}
|
||||
}
|
||||
|
||||
#loadingBar .progress.indeterminate {
|
||||
#loadingBar.indeterminate .progress {
|
||||
transform: none;
|
||||
background-color: rgba(153, 153, 153, 1);
|
||||
transition: none;
|
||||
}
|
||||
|
||||
#loadingBar .indeterminate .glimmer {
|
||||
#loadingBar.indeterminate .progress .glimmer {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
|
|
@ -161,7 +161,7 @@ const PDFViewerApplication = {
|
|||
},
|
||||
|
||||
get loadingBar() {
|
||||
const bar = new pdfjsViewer.ProgressBar("#loadingBar");
|
||||
const bar = new pdfjsViewer.ProgressBar("loadingBar");
|
||||
|
||||
return pdfjsLib.shadow(this, "loadingBar", bar);
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue