js: Convert static/js/settings_muting.js to ES6 module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-02-10 08:06:24 -08:00 committed by Tim Abbott
parent c366386679
commit 86dfb35ff3
6 changed files with 10 additions and 14 deletions

View File

@ -241,7 +241,6 @@
"settings_exports": false,
"settings_linkifiers": false,
"settings_invites": false,
"settings_muting": false,
"settings_notifications": false,
"settings_org": false,
"settings_panel_menu": false,

View File

@ -132,7 +132,6 @@ import "../settings_account";
import "../settings_display";
import "../settings_notifications";
import "../settings_bots";
import "../settings_muting";
import "../settings_sections";
import "../settings_emoji";
import "../settings_exports";

View File

@ -109,7 +109,6 @@ declare let settings_emoji: any;
declare let settings_exports: any;
declare let settings_invites: any;
declare let settings_linkifiers: any;
declare let settings_muting: any;
declare let settings_notifications: any;
declare let settings_org: any;
declare let settings_panel_menu: any;

View File

@ -4,6 +4,7 @@ const render_muted_topic_ui_row = require("../templates/muted_topic_ui_row.hbs")
const render_topic_muted = require("../templates/topic_muted.hbs");
const feedback_widget = require("./feedback_widget");
const settings_muting = require("./settings_muting");
function timestamp_ms() {
return Date.now();

View File

@ -1,9 +1,7 @@
"use strict";
export let loaded = false;
exports.loaded = false;
exports.set_up = function () {
exports.loaded = true;
export function set_up() {
loaded = true;
$("body").on("click", ".settings-unmute-topic", function (e) {
const $row = $(this).closest("tr");
const stream_id = Number.parseInt($row.attr("data-stream-id"), 10);
@ -16,10 +14,8 @@ exports.set_up = function () {
});
muting_ui.set_up_muted_topics_ui();
};
}
exports.reset = function () {
exports.loaded = false;
};
window.settings_muting = exports;
export function reset() {
loaded = false;
}

View File

@ -1,5 +1,7 @@
"use strict";
const settings_muting = require("./settings_muting");
const load_func_dict = new Map(); // group -> function
const loaded_groups = new Set();