From fcc65c820acd9be49234acc199d739befd6eb5c1 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Fri, 20 Sep 2019 14:55:09 +0300 Subject: [PATCH] [DE] Caption Dialog (saving labels in json) --- apps/documenteditor/main/app/view/CaptionDialog.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/documenteditor/main/app/view/CaptionDialog.js b/apps/documenteditor/main/app/view/CaptionDialog.js index e9dfa007d..3085b33c3 100644 --- a/apps/documenteditor/main/app/view/CaptionDialog.js +++ b/apps/documenteditor/main/app/view/CaptionDialog.js @@ -170,8 +170,7 @@ define([ arr = Common.localStorage.getItem("de-settings-captions") || ''; Common.Utils.InternalSettings.set("de-settings-captions", arr); } - arr = arr ? arr.split(';') : []; - arr = _.map(arr, function(str){ return { displayValue: str, value: str, type: 1 }; }); + arr = arr ? JSON.parse(arr) : []; // 0 - not removable this.arrLabel = arr.concat([{ displayValue: this.textEquation, value: this.textEquation, type: 0 }, @@ -352,9 +351,10 @@ define([ }, close: function() { - var val = _.pluck(_.where(this.arrLabel, {type: 1}), 'displayValue').join(';'); - Common.localStorage.setItem("de-settings-captions", val); - Common.Utils.InternalSettings.set("de-settings-captions", val); + var val = _.where(this.arrLabel, {type: 1}), + valJson = JSON.stringify(val); + Common.localStorage.setItem("de-settings-captions", valJson); + Common.Utils.InternalSettings.set("de-settings-captions", valJson); Common.Views.AdvancedSettingsWindow.prototype.close.apply(this, arguments); },