mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Enable the no-lonely-if
ESLint rule
These changes were mostly done automatically, using `gulp lint --fix`, and only a few spots with comments needed manual tweaking; please see https://eslint.org/docs/latest/rules/no-lonely-if
This commit is contained in:
parent
abb24f82fb
commit
c018070e80
15 changed files with 108 additions and 147 deletions
|
@ -127,12 +127,10 @@ class Field extends PDFObject {
|
|||
indices.forEach(i => {
|
||||
this._value.push(this._items[i].displayValue);
|
||||
});
|
||||
} else {
|
||||
if (indices.length > 0) {
|
||||
indices = indices.splice(1, indices.length - 1);
|
||||
this._currentValueIndices = indices[0];
|
||||
this._value = this._items[this._currentValueIndices];
|
||||
}
|
||||
} else if (indices.length > 0) {
|
||||
indices = indices.splice(1, indices.length - 1);
|
||||
this._currentValueIndices = indices[0];
|
||||
this._value = this._items[this._currentValueIndices];
|
||||
}
|
||||
this._send({ id: this._id, indices });
|
||||
}
|
||||
|
@ -389,12 +387,10 @@ class Field extends PDFObject {
|
|||
--this._currentValueIndices[index];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this._currentValueIndices === nIdx) {
|
||||
this._currentValueIndices = this.numItems > 0 ? 0 : -1;
|
||||
} else if (this._currentValueIndices > nIdx) {
|
||||
--this._currentValueIndices;
|
||||
}
|
||||
} else if (this._currentValueIndices === nIdx) {
|
||||
this._currentValueIndices = this.numItems > 0 ? 0 : -1;
|
||||
} else if (this._currentValueIndices > nIdx) {
|
||||
--this._currentValueIndices;
|
||||
}
|
||||
|
||||
this._send({ id: this._id, remove: nIdx });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue