mirror of https://github.com/zulip/zulip.git
settings: Remove save changes button from "UI settings" section.
Fixes: #6330.
This commit is contained in:
parent
63bbbba5aa
commit
f82c5e9626
|
@ -5,35 +5,34 @@ var exports = {};
|
|||
exports.set_up = function () {
|
||||
$("#ui-settings-status").hide();
|
||||
|
||||
$("#ui-settings").on("click", "input[name='change_settings']", function (e) {
|
||||
$("#ui-settings .change-setting").change(function (e) {
|
||||
e.preventDefault();
|
||||
var labs_updates = {};
|
||||
_.each(["autoscroll_forever", "default_desktop_notifications"],
|
||||
function (setting) {
|
||||
labs_updates[setting] = $("#" + setting).is(":checked");
|
||||
});
|
||||
|
||||
channel.patch({
|
||||
url: '/json/settings/ui',
|
||||
data: labs_updates,
|
||||
success: function (resp, statusText, xhr) {
|
||||
var message = i18n.t("Updated settings! You will need to reload for these changes to take effect.", page_params);
|
||||
var result = JSON.parse(xhr.responseText);
|
||||
var ui_settings_status = $('#ui-settings-status').expectOne();
|
||||
|
||||
if (result.autoscroll_forever !== undefined) {
|
||||
page_params.autoscroll_forever = result.autoscroll_forever;
|
||||
resize.resize_page_components();
|
||||
}
|
||||
|
||||
ui_report.success(message, ui_settings_status);
|
||||
},
|
||||
error: function (xhr) {
|
||||
ui_report.error(i18n.t("Error changing settings"), xhr, $('#ui-settings-status').expectOne());
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
channel.patch({
|
||||
url: '/json/settings/ui',
|
||||
data: labs_updates,
|
||||
success: function (resp, statusText, xhr) {
|
||||
var message = i18n.t("Updated settings! You will need to reload for these changes to take effect.", page_params);
|
||||
var result = JSON.parse(xhr.responseText);
|
||||
var ui_settings_status = $('#ui-settings-status').expectOne();
|
||||
|
||||
if (result.autoscroll_forever !== undefined) {
|
||||
page_params.autoscroll_forever = result.autoscroll_forever;
|
||||
resize.resize_page_components();
|
||||
}
|
||||
|
||||
ui_report.success(message, ui_settings_status);
|
||||
},
|
||||
error: function (xhr) {
|
||||
ui_report.error(i18n.t("Error changing settings"), xhr, $('#ui-settings-status').expectOne());
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
return exports;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<div class="side-padded-container">
|
||||
<div class="input-group">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" class="inline-block" name="autoscroll_forever" id="autoscroll_forever"
|
||||
<input type="checkbox" class="inline-block change-setting" name="autoscroll_forever" id="autoscroll_forever"
|
||||
{{#if page_params.autoscroll_forever}}
|
||||
checked="checked"
|
||||
{{/if}} />
|
||||
|
@ -20,7 +20,7 @@
|
|||
</div>
|
||||
<div class="input-group">
|
||||
<label class="checkbox">
|
||||
<input type="checkbox" class="inline-block" name="default_desktop_notifications" id="default_desktop_notifications"
|
||||
<input type="checkbox" class="inline-block change-setting" name="default_desktop_notifications" id="default_desktop_notifications"
|
||||
{{#if page_params.default_desktop_notifications}}
|
||||
checked="checked"
|
||||
{{/if}} />
|
||||
|
@ -31,11 +31,5 @@
|
|||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="input-group no-border">
|
||||
<div class="ui-submission">
|
||||
<input type="submit" name="change_settings" value="{{t 'Save changes' }}" class="button rounded sea-green" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue