Skip to content

Commit

Permalink
fix(delete): update the message and wrap the delete function for onclick
Browse files Browse the repository at this point in the history
  • Loading branch information
Joxit committed Jan 19, 2020
1 parent 8b7bd6c commit 8524c0d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
3 changes: 2 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@
- [@wuyue92tree](https://github.com/wuyue92tree)
- Giovanni Toraldo [@gionn](https://github.com/gionn)
- [@marcusblake](https://github.com/marcusblake)
- Dario [@pidario](https://github.com/pidario)
- Dario [@pidario](https://github.com/pidario)
- Jernej K. [Cvetk0](https://github.com/Cvetk0)
2 changes: 1 addition & 1 deletion dist/scripts/docker-registry-ui-static.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/scripts/docker-registry-ui.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docker-registry-ui",
"version": "1.4.2",
"version": "1.4.3",
"scripts": {
"build": "./node_modules/gulp/bin/gulp.js build"
},
Expand Down
19 changes: 11 additions & 8 deletions src/tags/remove-image.tag
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
if (self.multiDelete == self.opts.multiDelete) {
return;
}
if (this.tags['material-button']) {
this.delete = this.tags['material-button'].root.onclick = function(ignoreError) {
if (self.tags['material-button']) {
self.delete = function(ignoreError) {
const name = self.opts.image.name;
const tag = self.opts.image.tag;
registryUI.taglist.go(name);
Expand All @@ -44,7 +44,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
registryUI.taglist.display()
registryUI.snackbar('Deleting ' + name + ':' + tag + ' image. Run `registry garbage-collect config.yml` on your registry');
} else if (this.status == 404) {
ignoreError || registryUI.errorSnackbar('Digest not found');
ignoreError || registryUI.errorSnackbar('Digest not found for this image in your registry.');
} else {
registryUI.snackbar(this.responseText);
}
Expand All @@ -56,14 +56,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
});
oReq.send();
};
self.tags['material-button'].root.onclick = function() {
self.delete();
}
}

if (this.tags['material-checkbox']) {
if (!this.opts.multiDelete && this.tags['material-checkbox'].checked) {
this.tags['material-checkbox'].toggle();
if (self.tags['material-checkbox']) {
if (!self.opts.multiDelete && self.tags['material-checkbox'].checked) {
self.tags['material-checkbox'].toggle();
}
this.tags['material-checkbox'].on('toggle', function() {
registryUI.taglist.instance.trigger('toggle-remove-image', this.checked);
self.tags['material-checkbox'].on('toggle', function() {
registryUI.taglist.instance.trigger('toggle-remove-image', self.checked);
});
}
self.multiDelete = self.opts.multiDelete;
Expand Down

0 comments on commit 8524c0d

Please sign in to comment.