Lightbox delete should close lightbox

Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
James Ketr 2018-10-17 20:37:40 -07:00
parent 562debdd04
commit 2e98b93078
2 changed files with 30 additions and 18 deletions

View File

@ -179,6 +179,10 @@ Polymer({
}, },
onKeyDown: function(e) { onKeyDown: function(e) {
if (!this.active) {
return;
}
if (e.ctrlKey || e.altKey || e.metaKey || e.shiftKey) { if (e.ctrlKey || e.altKey || e.metaKey || e.shiftKey) {
return; return;
} }
@ -202,6 +206,7 @@ Polymer({
console.log(e.keyCode); console.log(e.keyCode);
break; break;
} }
if (this.hasFocus) { if (this.hasFocus) {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
@ -237,7 +242,12 @@ Polymer({
}, },
close: function() { close: function() {
if (this.closed) {
return;
}
this.style.opacity = 0; this.style.opacity = 0;
this.async(function() { this.async(function() {
this.setActive(false); this.setActive(false);
this.style.display = 'none'; this.style.display = 'none';

View File

@ -1344,6 +1344,8 @@
} }
window.fetch("api/v1/photos/" + thumbnail.item.id + query, window.fetch("api/v1/photos/" + thumbnail.item.id + query,
this._removeImageAfterFetch.bind(this, thumbnail, function() { this._removeImageAfterFetch.bind(this, thumbnail, function() {
/* If there is a lightbox, close the lightbox */
this.$.lightbox.close();
/* In duplicates mode, if an image is deleted it has the same /* In duplicates mode, if an image is deleted it has the same
* effect as renaming it since it removes it from the view */ * effect as renaming it since it removes it from the view */
if (this.mode != "duplicates") { if (this.mode != "duplicates") {