-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlisting-detail.js
More file actions
28 lines (22 loc) · 1.04 KB
/
listing-detail.js
File metadata and controls
28 lines (22 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { notificationController } from "./notification/notification-controller.js";
import { listingDetailController } from "./listing-detail/listing-detail-controller.js";
import { sessionController } from "./session/session-controller.js";
const notificationList = document.querySelector(".notification-list");
const listingDetail = document.querySelector("#listingDetail");
const session = document.querySelector("#session");
sessionController(session);
const { showNotification } = notificationController(notificationList);
listingDetail.addEventListener("error-loading-listing", (event) => {
showNotification(event.detail.message, event.detail.type);
event.stopPropagation();
});
listingDetail.addEventListener("delete-listing-notification", (event) => {
showNotification(event.detail.message, event.detail.type);
event.stopPropagation();
});
document.addEventListener("DOMContentLoaded", () => {
listingDetailController(listingDetail);
});
window.addEventListener("offline", () => {
showNotification("Has perdido la conexión!", "error");
});