compose: Create a separate "New stream message" title editing function.

To reduce code duplication, create a new function for editing the
"New stream message" button title.
This commit is contained in:
Marco Burstein
2018-08-11 14:26:00 -07:00
committed by Tim Abbott
parent 62bee26ea7
commit 4dbf59dbaa

View File

@@ -100,14 +100,17 @@ exports.clear_preview_area = function () {
$("#markdown_preview").show();
};
function update_stream_button(title) {
$("#left_bar_compose_stream_button_big").text(title);
$("#left_bar_compose_stream_button_big").prop("title", title);
}
exports.update_stream_button_for_private = function () {
$("#left_bar_compose_stream_button_big").html(i18n.t("New stream message"));
$("#left_bar_compose_stream_button_big").prop("title", i18n.t("New stream message"));
update_stream_button(i18n.t("New stream message"));
};
exports.update_stream_button_for_stream = function () {
$("#left_bar_compose_stream_button_big").html(i18n.t("New topic"));
$("#left_bar_compose_stream_button_big").prop("title", i18n.t("New topic"));
update_stream_button(i18n.t("New topic"));
};
function update_fade() {