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) {
|
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';
|
||||||
|
@ -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") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user