Only remove inbox entry after share has been triggered
This commit is contained in:
parent
8b86e2f123
commit
bc45bda517
|
@ -23,7 +23,7 @@ export default class extends Controller {
|
||||||
this.twitterTarget.addEventListener('click', () => this.close());
|
this.twitterTarget.addEventListener('click', () => this.close());
|
||||||
this.tumblrTarget.addEventListener('click', () => this.close());
|
this.tumblrTarget.addEventListener('click', () => this.close());
|
||||||
this.telegramTarget.addEventListener('click', () => this.close());
|
this.telegramTarget.addEventListener('click', () => this.close());
|
||||||
this.otherTarget.addEventListener('click', () => this.close());
|
this.otherTarget.addEventListener('click', () => this.closeAfterShare());
|
||||||
|
|
||||||
if (this.hasCustomTarget) {
|
if (this.hasCustomTarget) {
|
||||||
this.customTarget.addEventListener('click', () => this.close());
|
this.customTarget.addEventListener('click', () => this.close());
|
||||||
|
@ -50,4 +50,8 @@ export default class extends Controller {
|
||||||
close(): void {
|
close(): void {
|
||||||
(this.element.closest(".inbox-entry")).remove();
|
(this.element.closest(".inbox-entry")).remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
closeAfterShare(): void {
|
||||||
|
this.otherTarget.addEventListener('retrospring:shared', () => this.close());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue