Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

hotspots: Keep track of open state in js.

Steve Gattuso36bf49bc8daf
diff --git a/web/src/hotspots.js b/web/src/hotspots.js
index 9f772dc7e33..5975a648b99 100644
--- a/web/src/hotspots.js
+++ b/web/src/hotspots.js
@@ -57,6 +57,10 @@ const HOTSPOT_LOCATIONS = new Map([
],
]);
+const meta = {
+ opened_hotspot_name: null,
+};
+
export function post_hotspot_as_read(hotspot_name) {
channel.post({
url: "/json/users/me/hotspots",
@@ -236,7 +240,7 @@ function insert_hotspot_into_DOM(hotspot) {
}
export function is_open() {
- return $(".hotspot.overlay").hasClass("show");
+ return meta.opened_hotspot_name !== null;
}
export function close_hotspot_icon(elem) {
@@ -296,9 +300,12 @@ export function initialize() {
duration: 300,
},
);
+
+ meta.opened_hotspot_name = null;
}.bind(this),
});
+ meta.opened_hotspot_name = hotspot_name;
e.preventDefault();
e.stopPropagation();
});