Enable the no-else-return
ESLint rule
Using `else` after `return` is not necessary, and can often lead to unnecessarily cluttered code. By using the `no-else-return` rule in ESLint we can avoid this pattern, see http://eslint.org/docs/rules/no-else-return.
This commit is contained in:
parent
049d7fa277
commit
4046d67fde
19 changed files with 67 additions and 79 deletions
|
@ -833,14 +833,13 @@ var PDFViewer = (function pdfViewer() {
|
|||
_getVisiblePages: function () {
|
||||
if (!this.isInPresentationMode) {
|
||||
return getVisibleElements(this.container, this._pages, true);
|
||||
} else {
|
||||
// The algorithm in getVisibleElements doesn't work in all browsers and
|
||||
// configurations when presentation mode is active.
|
||||
var visible = [];
|
||||
var currentPage = this._pages[this._currentPageNumber - 1];
|
||||
visible.push({ id: currentPage.id, view: currentPage });
|
||||
return { first: currentPage, last: currentPage, views: visible };
|
||||
}
|
||||
// The algorithm in getVisibleElements doesn't work in all browsers and
|
||||
// configurations when presentation mode is active.
|
||||
var visible = [];
|
||||
var currentPage = this._pages[this._currentPageNumber - 1];
|
||||
visible.push({ id: currentPage.id, view: currentPage });
|
||||
return { first: currentPage, last: currentPage, views: visible };
|
||||
},
|
||||
|
||||
cleanup: function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue