From b7ca94e234722adea6260060e446a84736caf70f Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 18 Apr 2024 18:28:07 +0300 Subject: [PATCH] [DE] Save auto-update option for date/time --- apps/documenteditor/main/app/view/DateTimeDialog.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/main/app/view/DateTimeDialog.js b/apps/documenteditor/main/app/view/DateTimeDialog.js index d07e9c0afa..39126c54b9 100644 --- a/apps/documenteditor/main/app/view/DateTimeDialog.js +++ b/apps/documenteditor/main/app/view/DateTimeDialog.js @@ -109,12 +109,21 @@ define([ this.updateFormats(record.value); }, this)); + var value = Common.Utils.InternalSettings.get("de-date-auto-update"); + if (value==null || value==undefined) { + value = Common.localStorage.getBool("de-date-auto-update"); + Common.Utils.InternalSettings.set("de-date-auto-update", value); + } + this.chUpdate = new Common.UI.CheckBox({ el: $('#datetime-dlg-update'), - labelText: this.textUpdate + labelText: this.textUpdate, + value: !!value }); this.chUpdate.on('change', _.bind(function(field, newValue, oldValue, eOpts){ this.onSelectFormat(this.listFormats, null, this.listFormats.getSelectedRec()); + Common.localStorage.setBool("de-date-auto-update", newValue==='checked'); + Common.Utils.InternalSettings.set("de-date-auto-update", newValue==='checked'); }, this)); this.listFormats = new Common.UI.ListView({