Use for...of in a couple of loops in web/toolbar.js and web/secondary_toolbar.js

This commit is contained in:
Jonas Jenwald 2019-11-15 23:23:14 +01:00
parent 3edaebbded
commit eaa2e216f4
2 changed files with 2 additions and 6 deletions

View File

@ -169,9 +169,7 @@ class SecondaryToolbar {
this.toggleButton.addEventListener('click', this.toggle.bind(this));
// All items within the secondary toolbar.
for (let button in this.buttons) {
let { element, eventName, close, eventDetails, } = this.buttons[button];
for (const { element, eventName, close, eventDetails, } of this.buttons) {
element.addEventListener('click', (evt) => {
if (eventName !== null) {
let details = { source: this, };

View File

@ -201,10 +201,8 @@ class Toolbar {
let customScale = Math.round(pageScale * 10000) / 100;
this.l10n.get('page_scale_percent', { scale: customScale, },
'{{scale}}%').then((msg) => {
let options = items.scaleSelect.options;
let predefinedValueFound = false;
for (let i = 0, ii = options.length; i < ii; i++) {
let option = options[i];
for (const option of items.scaleSelect.options) {
if (option.value !== pageScaleValue) {
option.selected = false;
continue;