diff --git a/src/tags/pagination.tag b/src/tags/pagination.tag index 1263a9e..0607d1a 100644 --- a/src/tags/pagination.tag +++ b/src/tags/pagination.tag @@ -30,7 +30,6 @@ along with this program. If not, see . var buttons = Array.isArray(this.tags['material-button']) ? this.tags['material-button'] : [this.tags['material-button']]; buttons.forEach(function(button) { button.root.onclick = function() { - registryUI.updateQueryString(registryUI.getQueryParams({ page: button.p.page }) ); registryUI.taglist.instance.trigger('page-update', button.p.page) } }); diff --git a/src/tags/remove-image.tag b/src/tags/remove-image.tag index d3ed8c5..5e0212a 100644 --- a/src/tags/remove-image.tag +++ b/src/tags/remove-image.tag @@ -22,7 +22,55 @@ along with this program. If not, see . diff --git a/src/tags/taglist.tag b/src/tags/taglist.tag index c207d11..f06bedf 100644 --- a/src/tags/taglist.tag +++ b/src/tags/taglist.tag @@ -114,7 +114,8 @@ along with this program. If not, see . }); this.on('page-update', function(page) { - self.page = page; + self.page = page < 1 ? 1 : page; + registryUI.updateQueryString(registryUI.getQueryParams({ page: self.page }) ); this.toDelete = 0; this.update(); }); @@ -167,6 +168,7 @@ along with this program. If not, see . registryUI.taglist.tags = registryUI.taglist.tags.map(function(tag) { return new registryUI.DockerImage(registryUI.taglist.name, tag); }).sort(registryUI.DockerImage.compare); + self.trigger('page-update', Math.min(self.page, registryUI.getNumPages(registryUI.taglist.tags))) } else if (this.status == 404) { registryUI.snackbar('Server not found', true); } else {