mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
ts: Convert compose_error module to TypeScript.
This commit is contained in:
committed by
Tim Abbott
parent
97a27eb239
commit
92912a3b1c
26
static/js/compose_error.ts
Normal file
26
static/js/compose_error.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import $ from "jquery";
|
||||
|
||||
import * as common from "./common";
|
||||
|
||||
export function show(error_html: string, bad_input?: JQuery, alert_class = "alert-error"): void {
|
||||
$("#compose-send-status")
|
||||
.removeClass(common.status_classes)
|
||||
.addClass(alert_class)
|
||||
.stop(true)
|
||||
.fadeTo(0, 1);
|
||||
$("#compose-error-msg").html(error_html);
|
||||
$("#compose-send-button").prop("disabled", false);
|
||||
$("#sending-indicator").hide();
|
||||
if (bad_input !== undefined) {
|
||||
bad_input.trigger("focus").trigger("select");
|
||||
}
|
||||
}
|
||||
|
||||
export function show_not_subscribed(error_html: string, bad_input?: JQuery): void {
|
||||
show(error_html, bad_input, "home-error-bar");
|
||||
$(".compose-send-status-close").hide();
|
||||
}
|
||||
|
||||
export function hide(): void {
|
||||
$("#compose-send-status").stop(true).fadeOut(500);
|
||||
}
|
||||
Reference in New Issue
Block a user