Use for...of
in a couple of loops in web/toolbar.js
and web/secondary_toolbar.js
This commit is contained in:
parent
3edaebbded
commit
eaa2e216f4
@ -169,9 +169,7 @@ class SecondaryToolbar {
|
|||||||
this.toggleButton.addEventListener('click', this.toggle.bind(this));
|
this.toggleButton.addEventListener('click', this.toggle.bind(this));
|
||||||
|
|
||||||
// All items within the secondary toolbar.
|
// All items within the secondary toolbar.
|
||||||
for (let button in this.buttons) {
|
for (const { element, eventName, close, eventDetails, } of this.buttons) {
|
||||||
let { element, eventName, close, eventDetails, } = this.buttons[button];
|
|
||||||
|
|
||||||
element.addEventListener('click', (evt) => {
|
element.addEventListener('click', (evt) => {
|
||||||
if (eventName !== null) {
|
if (eventName !== null) {
|
||||||
let details = { source: this, };
|
let details = { source: this, };
|
||||||
|
@ -201,10 +201,8 @@ class Toolbar {
|
|||||||
let customScale = Math.round(pageScale * 10000) / 100;
|
let 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 options = items.scaleSelect.options;
|
|
||||||
let predefinedValueFound = false;
|
let predefinedValueFound = false;
|
||||||
for (let i = 0, ii = options.length; i < ii; i++) {
|
for (const option of items.scaleSelect.options) {
|
||||||
let option = options[i];
|
|
||||||
if (option.value !== pageScaleValue) {
|
if (option.value !== pageScaleValue) {
|
||||||
option.selected = false;
|
option.selected = false;
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user