diff --git a/apps/common/main/lib/template/AutoCorrectDialog.template b/apps/common/main/lib/template/AutoCorrectDialog.template
new file mode 100644
index 000000000..f2bb6aa9a
--- /dev/null
+++ b/apps/common/main/lib/template/AutoCorrectDialog.template
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+
+
+
+ |
+
+
+
+
+ |
+
+
+
+
+
+
+ |
+
+
+
+
+
diff --git a/apps/common/main/lib/view/AutoCorrectDialog.js b/apps/common/main/lib/view/AutoCorrectDialog.js
index 85f43800e..0aed09e80 100644
--- a/apps/common/main/lib/view/AutoCorrectDialog.js
+++ b/apps/common/main/lib/view/AutoCorrectDialog.js
@@ -40,17 +40,17 @@
*/
if (Common === undefined)
var Common = {};
-define([
+define([ 'text!common/main/lib/template/AutoCorrectDialog.template',
'common/main/lib/component/ListView',
'common/main/lib/component/Window'
-], function () { 'use strict';
+], function (contentTemplate) { 'use strict';
- Common.Views.AutoCorrectDialog = Common.UI.Window.extend(_.extend({
+ Common.Views.AutoCorrectDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({
options: {
- width: 448,
- height: 444,
- cls: 'modal-dlg',
- buttons: null
+ contentWidth: 375,
+ height: 430,
+ buttons: null,
+ toggleGroup: 'autocorrect-dialog-group'
},
initialize : function(options) {
@@ -58,58 +58,32 @@ define([
this.appPrefix = (filter && filter.length) ? filter.split(',')[0] : '';
_.extend(this.options, {
- title: this.textTitle
+ title: this.textTitle,
+ storageName: this.appPrefix + 'autocorrect-dialog-category',
+ items: [
+ {panelId: 'id-autocorrect-dialog-settings-math', panelCaption: this.textMathCorrect},
+ {panelId: 'id-autocorrect-dialog-settings-recognized', panelCaption: this.textLock}
+ ],
+ template: [
+ '',
+ '',
+ '
',
+ '
' + _.template(contentTemplate)({scope: this}) + '
',
+ '
',
+ '',
+ ''
+ ].join('')
}, options || {});
- this.template = [
- '',
- '
',
- '
',
- '',
- '',
- '',
- ' | ',
- '
',
- '',
- '',
- '',
- ' | ',
- '
',
- '',
- '',
- '',
- '',
- ' | ',
- '
',
- '',
- '',
- '',
- '',
- ' | ',
- '
',
- '',
- '',
- '',
- ' | ',
- '
',
- '',
- '',
- '',
- '',
- '',
- ' | ',
- '
',
- '
',
- '
',
- '
',
- ''
- ].join('');
-
- this.options.tpl = _.template(this.template)(this.options);
this.mathStore = this.options.mathStore || new Common.UI.DataViewStore();
this.api = this.options.api;
+ this.handler = this.options.handler;
var path = this.appPrefix + "settings-math-correct";
var value = Common.Utils.InternalSettings.get(path + "-add");
@@ -117,11 +91,11 @@ define([
value = Common.Utils.InternalSettings.get(path + "-rem");
this.arrRem = value ? JSON.parse(value) : [];
- Common.UI.Window.prototype.initialize.call(this, this.options);
+ Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options);
},
render: function() {
- Common.UI.Window.prototype.render.call(this);
+ Common.Views.AdvancedSettingsWindow.prototype.render.call(this);
var $window = this.getChild();
var me = this;
@@ -220,9 +194,21 @@ define([
});
this.btnDelete.on('click', _.bind(this.onDelete, this, false));
- this.updateControls();
+ this.btnsCategory[0].on('click', _.bind(this.onMathCategoryClick, this, false));
- $window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this));
+ this.afterRender();
+ },
+
+ afterRender: function() {
+ this.updateControls();
+ if (this.storageName) {
+ var value = Common.localStorage.getItem(this.storageName);
+ this.setActiveCategory((value!==null) ? parseInt(value) : 0);
+ }
+ },
+
+ getSettings: function() {
+ return;
},
onSelectMathItem: function(lisvView, itemView, record) {
@@ -254,30 +240,29 @@ define([
},
show: function() {
- Common.UI.Window.prototype.show.apply(this, arguments);
+ Common.Views.AdvancedSettingsWindow.prototype.show.apply(this, arguments);
- var me = this;
- _.delay(function(){
- $('input', me.inputReplace.cmpEl).select().focus();
- },50);
-
- _.delay(function(){
- me.mathList.setStore(me.mathStore);
- me.mathList.onResetItems();
- },100);
+ var value = this.getActiveCategory();
+ if (value==0) this.onMathCategoryClick(true);
},
close: function() {
- Common.UI.Window.prototype.close.apply(this, arguments);
+ Common.Views.AdvancedSettingsWindow.prototype.close.apply(this, arguments);
this.mathList && this.mathList.deselectAll();
},
- onBtnClick: function(event) {
- this.close();
- },
+ onMathCategoryClick: function(delay) {
+ var me = this;
+ _.delay(function(){
+ $('input', me.inputReplace.cmpEl).select().focus();
+ },delay ? 50 : 0);
- onPrimary: function(event) {
- return true;
+ if (me.mathList.store.length < me.mathStore.length) {
+ _.delay(function(){
+ me.mathList.setStore(me.mathStore);
+ me.mathList.onResetItems();
+ },delay ? 100 : 10);
+ }
},
onDelete: function() {
diff --git a/apps/common/main/resources/less/advanced-settings-window.less b/apps/common/main/resources/less/advanced-settings-window.less
index 42c801961..49085e69c 100644
--- a/apps/common/main/resources/less/advanced-settings-window.less
+++ b/apps/common/main/resources/less/advanced-settings-window.less
@@ -21,6 +21,7 @@
padding: 9px 2px 9px 12px;
line-height: normal;
height: auto;
+ white-space: normal;
}
}