From 8560476ce7e124c89f021f1875d5b0a0074ca186 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 26 Sep 2019 17:34:01 +0300 Subject: [PATCH] [DE] Fix Bug 42977. Enable search in code pages combobox --- apps/common/main/lib/view/OpenDialog.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/common/main/lib/view/OpenDialog.js b/apps/common/main/lib/view/OpenDialog.js index a43a226c1..467717eb6 100644 --- a/apps/common/main/lib/view/OpenDialog.js +++ b/apps/common/main/lib/view/OpenDialog.js @@ -231,6 +231,9 @@ define([ delimiter = this.cmbDelimiter ? this.cmbDelimiter.getValue() : null, delimiterChar = (delimiter == -1) ? this.inputDelimiter.getValue() : null; (delimiter == -1) && (delimiter = null); + if (!this.closable && this.type == Common.Utils.importTextType.TXT) { //save last encoding only for opening txt files + Common.localStorage.setItem("de-settings-open-encoding", encoding); + } this.handler.call(this, state, encoding, delimiter, delimiterChar); } } @@ -284,11 +287,17 @@ define([ data: listItems, editable: false, disabled: true, + search: true, itemsTemplate: itemsTemplate }); this.cmbEncoding.setDisabled(false); - this.cmbEncoding.setValue((this.settings && this.settings.asc_getCodePage()) ? this.settings.asc_getCodePage() : encodedata[0][0]); + var encoding = (this.settings && this.settings.asc_getCodePage()) ? this.settings.asc_getCodePage() : encodedata[0][0]; + if (!this.closable && this.type == Common.Utils.importTextType.TXT) { // only for opening txt files + var value = Common.localStorage.getItem("de-settings-open-encoding"); + value && (encoding = parseInt(value)); + } + this.cmbEncoding.setValue(encoding); if (this.preview) this.cmbEncoding.on('selected', _.bind(this.onCmbEncodingSelect, this));