Lightbox delete should close lightbox
Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
parent
562debdd04
commit
2e98b93078
@ -179,6 +179,10 @@ Polymer({
|
||||
},
|
||||
|
||||
onKeyDown: function(e) {
|
||||
if (!this.active) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.ctrlKey || e.altKey || e.metaKey || e.shiftKey) {
|
||||
return;
|
||||
}
|
||||
@ -202,6 +206,7 @@ Polymer({
|
||||
console.log(e.keyCode);
|
||||
break;
|
||||
}
|
||||
|
||||
if (this.hasFocus) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
@ -237,7 +242,12 @@ Polymer({
|
||||
},
|
||||
|
||||
close: function() {
|
||||
if (this.closed) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.style.opacity = 0;
|
||||
|
||||
this.async(function() {
|
||||
this.setActive(false);
|
||||
this.style.display = 'none';
|
||||
|
@ -1344,26 +1344,28 @@
|
||||
}
|
||||
window.fetch("api/v1/photos/" + thumbnail.item.id + query,
|
||||
this._removeImageAfterFetch.bind(this, thumbnail, function() {
|
||||
/* In duplicates mode, if an image is deleted it has the same
|
||||
* effect as renaming it since it removes it from the view */
|
||||
if (this.mode != "duplicates") {
|
||||
return;
|
||||
}
|
||||
/* If there is now only one item with this thumbnail's name,
|
||||
* remove it from the view */
|
||||
var orphan = null;
|
||||
for (var i = 0; i < this.thumbnails.length; i++) {
|
||||
if (this.thumbnails[i].item.filename == thumbnail.item.filename) {
|
||||
if (orphan) {
|
||||
return;
|
||||
}
|
||||
orphan = this.thumbnails[i];
|
||||
/* If there is a lightbox, close the lightbox */
|
||||
this.$.lightbox.close();
|
||||
/* In duplicates mode, if an image is deleted it has the same
|
||||
* effect as renaming it since it removes it from the view */
|
||||
if (this.mode != "duplicates") {
|
||||
return;
|
||||
}
|
||||
/* If there is now only one item with this thumbnail's name,
|
||||
* remove it from the view */
|
||||
var orphan = null;
|
||||
for (var i = 0; i < this.thumbnails.length; i++) {
|
||||
if (this.thumbnails[i].item.filename == thumbnail.item.filename) {
|
||||
if (orphan) {
|
||||
return;
|
||||
}
|
||||
orphan = this.thumbnails[i];
|
||||
}
|
||||
if (orphan) {
|
||||
this._removeImageAfterFetch(orphan, null);
|
||||
}
|
||||
}.bind(this)), {}, "DELETE");
|
||||
}
|
||||
if (orphan) {
|
||||
this._removeImageAfterFetch(orphan, null);
|
||||
}
|
||||
}.bind(this)), {}, "DELETE");
|
||||
},
|
||||
|
||||
renameAction: function(thumbnail) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user