fix(delete): update the message and wrap the delete function for onclick

This commit is contained in:
Joxit 2020-01-20 00:11:45 +01:00
parent 8b7bd6cfb8
commit 8524c0d18b
No known key found for this signature in database
GPG Key ID: F526592B8E012263
5 changed files with 16 additions and 12 deletions

View File

@ -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)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -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"
},

View File

@ -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);
@ -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);
}
@ -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;