Skip to content

Commit

Permalink
Fix: pagination is not working on Edge browser #10
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaid-Safadi committed Jan 5, 2018
1 parent 20df3c4 commit bfcb2f4
Show file tree
Hide file tree
Showing 6 changed files with 1,535 additions and 1,505 deletions.
11 changes: 9 additions & 2 deletions Demo/JSLib/Query/QueryController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,15 @@

try {
var totalCount = xhr.getResponseHeader("X-Total-Count");
if (totalCount) {
this._studyPagerModel.setLinkHeader(xhr.getResponseHeader("link"), data.length, parseInt(totalCount, 10));
var linkHeader = xhr.getResponseHeader("link");

if (linkHeader) {
if (!totalCount)
{
totalCount = "-1";
}

this._studyPagerModel.setLinkHeader(linkHeader, data.length, parseInt(totalCount, 10));
this._studyPagerModel.currentOffset = offset;
this._studyPagerView.render();
this._studyPagerView.show();
Expand Down
2 changes: 1 addition & 1 deletion Demo/JSLib/Query/QueryPagerView.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion Demo/JSLib/Query/QueryPagerView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,20 @@ class QueryPagerView
this._$last.removeClass("disabled");
}

this._$pageInfo.text("Page: " + this.model.currentPage + "/" + this.model.pageCount);
if (this.model.pageCount >= this.model.currentPage) {
this._$pageInfo.text("Page: " + this.model.currentPage + "/" + this.model.pageCount);
}
else
{
this._$pageInfo.text("Page: " + this.model.currentPage);
}
}

public show()
{
this._$element.show();
}

public hide() {
this._$element.hide();
}
Expand Down
2 changes: 1 addition & 1 deletion Demo/Views/Demo/_AlertDlg.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<h4 class="modal-title" id="modal-sample-label"></h4>
</div>
<div class="model-body" >
<div class="model-body-content" style="height:300px"/>
<div class="model-body-content" style="height:300px"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-info"
Expand Down
Loading

0 comments on commit bfcb2f4

Please sign in to comment.