mirror of https://github.com/zulip/zulip.git
dialog_widget: Remove redundant `preventDefault` calls.
Removes redundant `preventDefault` and `stopPropagation` calls for the users of `dialog_widget.ts` module since we are already calling those functions in the submit button click handler now.
This commit is contained in:
parent
d14caa8400
commit
d44f7da1e1
|
@ -42,10 +42,7 @@ function update_alert_word_status(status_text, is_error) {
|
|||
$alert_word_status.show();
|
||||
}
|
||||
|
||||
function add_alert_word(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
function add_alert_word() {
|
||||
const alert_word = $("#add-alert-word-name").val().trim();
|
||||
|
||||
if (alert_words.has_alert_word(alert_word)) {
|
||||
|
|
|
@ -563,9 +563,7 @@ export function set_up() {
|
|||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
function validate_input(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
function validate_input() {
|
||||
const old_password = $("#old_password").val();
|
||||
const new_password = $("#new_password").val();
|
||||
|
||||
|
@ -618,9 +616,7 @@ export function set_up() {
|
|||
}
|
||||
});
|
||||
|
||||
function do_change_password(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
function do_change_password() {
|
||||
const $change_password_error = $("#change_password_modal").find("#dialog_error");
|
||||
$change_password_error.hide();
|
||||
|
||||
|
@ -683,9 +679,7 @@ export function set_up() {
|
|||
);
|
||||
});
|
||||
|
||||
function do_change_email(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
function do_change_email() {
|
||||
const $change_email_error = $("#change_email_modal").find("#dialog_error");
|
||||
const data = {};
|
||||
data.email = $("#change_email_form").find("input[name='email']").val();
|
||||
|
|
|
@ -292,10 +292,7 @@ export function add_a_new_bot() {
|
|||
});
|
||||
}
|
||||
|
||||
function validate_input(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
function validate_input() {
|
||||
const bot_short_name = $("#create_bot_short_name").val();
|
||||
|
||||
if (is_local_part(bot_short_name)) {
|
||||
|
|
|
@ -200,10 +200,7 @@ export function add_custom_emoji_post_render() {
|
|||
function show_modal() {
|
||||
const html_body = render_add_emoji();
|
||||
|
||||
function add_custom_emoji(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
function add_custom_emoji() {
|
||||
dialog_widget.show_dialog_spinner();
|
||||
|
||||
const $emoji_status = $("#dialog_error");
|
||||
|
|
|
@ -300,10 +300,7 @@ export function populate_user_groups() {
|
|||
}
|
||||
}
|
||||
|
||||
export function add_user_group(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
export function add_user_group() {
|
||||
const $user_group_status = $("#dialog_error");
|
||||
|
||||
const group = {
|
||||
|
|
|
@ -452,8 +452,6 @@ export function initialize() {
|
|||
});
|
||||
|
||||
function save_stream_info(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const sub = get_sub_for_target(e.currentTarget);
|
||||
|
||||
const url = `/json/streams/${sub.stream_id}`;
|
||||
|
|
|
@ -261,8 +261,6 @@ export function initialize() {
|
|||
});
|
||||
|
||||
function save_group_info(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
const group = get_user_group_for_target(e.currentTarget);
|
||||
|
||||
const url = `/json/user_groups/${group.id}`;
|
||||
|
|
Loading…
Reference in New Issue