Skip to content

Commit

Permalink
Bugfix #539 Only emit pageChage on actual change
Browse files Browse the repository at this point in the history
  • Loading branch information
timothyblue committed Dec 13, 2019
1 parent 5c5c466 commit b6e2531
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app/pdf-viewer/pdf-viewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,19 @@ export class PdfViewerComponent
this._cMapsUrl = cMapsUrl;
}

@Input('page')
@Input('page')
set page(_page) {
_page = parseInt(_page, 10) || 1;
const orginalPage = _page;

if (this._pdf) {
_page = this.getValidPageNumber(_page);
}

this._page = _page;
this.pageChange.emit(_page);
if (orginalPage !== _page) {
this.pageChange.emit(_page);
}
}

@Input('render-text')
Expand Down

0 comments on commit b6e2531

Please sign in to comment.