Skip to content

Commit

Permalink
GTL: Hide pagination on no records
Browse files Browse the repository at this point in the history
when transitioning from a GTL screen to another,
and the target page has no records,
the paging toolbar doesn't update and keeps showing the old data.

Hiding on 0 rows.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1548121
  • Loading branch information
himdel committed Feb 23, 2018
1 parent 15b7033 commit 9fbc691
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/assets/javascripts/controllers/report_data_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,10 +323,16 @@
}
this.setDefaults();
this.movePagination();

// pagination doesn't update on no records (components/data-table/data-table.html:4:99), hide it instead
if (! this.gtlData.rows.length) {
this.setExtraClasses();
}

this.$timeout(function() {
this.$window.ManageIQ.gtl.loading = false;
this.$window.ManageIQ.gtl.isFirst = this.settings.current === 1;
this.$window.ManageIQ.gtl.isLast = this.settings.current === this.settings.totla;
this.$window.ManageIQ.gtl.isLast = this.settings.current === this.settings.total;
}.bind(this));
return data;
}.bind(this));
Expand Down

0 comments on commit 9fbc691

Please sign in to comment.