Use const in toolbar.js
This commit is contained in:
parent
6316b2a195
commit
790b0aede6
@ -12,6 +12,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
/* eslint no-var: error, prefer-const: error */
|
||||||
|
|
||||||
import {
|
import {
|
||||||
animationStarted, DEFAULT_SCALE, DEFAULT_SCALE_VALUE, MAX_SCALE,
|
animationStarted, DEFAULT_SCALE, DEFAULT_SCALE_VALUE, MAX_SCALE,
|
||||||
@ -194,7 +195,7 @@ class Toolbar {
|
|||||||
items.zoomOut.disabled = (pageScale <= MIN_SCALE);
|
items.zoomOut.disabled = (pageScale <= MIN_SCALE);
|
||||||
items.zoomIn.disabled = (pageScale >= MAX_SCALE);
|
items.zoomIn.disabled = (pageScale >= MAX_SCALE);
|
||||||
|
|
||||||
let customScale = Math.round(pageScale * 10000) / 100;
|
const customScale = Math.round(pageScale * 10000) / 100;
|
||||||
this.l10n.get('page_scale_percent', { scale: customScale, },
|
this.l10n.get('page_scale_percent', { scale: customScale, },
|
||||||
'{{scale}}%').then((msg) => {
|
'{{scale}}%').then((msg) => {
|
||||||
let predefinedValueFound = false;
|
let predefinedValueFound = false;
|
||||||
@ -214,14 +215,14 @@ class Toolbar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateLoadingIndicatorState(loading = false) {
|
updateLoadingIndicatorState(loading = false) {
|
||||||
let pageNumberInput = this.items.pageNumber;
|
const pageNumberInput = this.items.pageNumber;
|
||||||
|
|
||||||
pageNumberInput.classList.toggle(PAGE_NUMBER_LOADING_INDICATOR, loading);
|
pageNumberInput.classList.toggle(PAGE_NUMBER_LOADING_INDICATOR, loading);
|
||||||
}
|
}
|
||||||
|
|
||||||
_adjustScaleWidth() {
|
_adjustScaleWidth() {
|
||||||
let container = this.items.scaleSelectContainer;
|
const container = this.items.scaleSelectContainer;
|
||||||
let select = this.items.scaleSelect;
|
const select = this.items.scaleSelect;
|
||||||
|
|
||||||
animationStarted.then(function() {
|
animationStarted.then(function() {
|
||||||
// Adjust the width of the zoom box to fit the content.
|
// Adjust the width of the zoom box to fit the content.
|
||||||
@ -232,7 +233,7 @@ class Toolbar {
|
|||||||
}
|
}
|
||||||
if (container.clientWidth > 0) {
|
if (container.clientWidth > 0) {
|
||||||
select.setAttribute('style', 'min-width: inherit;');
|
select.setAttribute('style', 'min-width: inherit;');
|
||||||
let width = select.clientWidth + SCALE_SELECT_CONTAINER_PADDING;
|
const width = select.clientWidth + SCALE_SELECT_CONTAINER_PADDING;
|
||||||
select.setAttribute('style', 'min-width: ' +
|
select.setAttribute('style', 'min-width: ' +
|
||||||
(width + SCALE_SELECT_PADDING) + 'px;');
|
(width + SCALE_SELECT_PADDING) + 'px;');
|
||||||
container.setAttribute('style', 'min-width: ' + width + 'px; ' +
|
container.setAttribute('style', 'min-width: ' + width + 'px; ' +
|
||||||
|
Loading…
Reference in New Issue
Block a user