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.

org settings: Fix change detection of setting input elements.

Pragati Agrawal1737cfdc7dbc
diff --git a/static/js/settings_org.js b/static/js/settings_org.js
index c96b8f7cd33..536830a8e58 100644
--- a/static/js/settings_org.js
+++ b/static/js/settings_org.js
@@ -463,10 +463,16 @@ exports.change_save_button_state = function ($element, state) {
show_hide_element($element, is_show, 800);
};
+function get_input_type(input_elem, input_type) {
+ if (["boolean", "string", "number"].includes(input_type)) {
+ return input_type;
+ }
+ return input_elem.data("setting-widget-type");
+}
+
exports.get_input_element_value = function (input_elem, input_type) {
input_elem = $(input_elem);
- input_type = ["boolean", "string", "number"].includes(input_type)
- || input_elem.data("setting-widget-type");
+ input_type = get_input_type(input_elem, input_type);
if (input_type) {
if (input_type === 'boolean') {
return input_elem.prop('checked');