diff --git a/apps/common/main/lib/view/AutoCorrectDialog.js b/apps/common/main/lib/view/AutoCorrectDialog.js index 48a9ca33a..fded9b49c 100644 --- a/apps/common/main/lib/view/AutoCorrectDialog.js +++ b/apps/common/main/lib/view/AutoCorrectDialog.js @@ -134,8 +134,8 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template', template: _.template(['
'].join('')), itemTemplate: _.template([ '
', - '
<%= replaced %>
', - '
<%= by %>
', + '
<%= replaced %>
', + '
<%= by %>
', '
' ].join('')), scrollAlwaysVisible: true @@ -146,6 +146,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template', el : $window.find('#auto-correct-replace'), allowBlank : true, validateOnChange : true, + maxLength : 31, validation : function () { return true; } }).on ('changing', function (input, value) { var _selectedItem; @@ -186,6 +187,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template', el : $window.find('#auto-correct-by'), allowBlank : true, validateOnChange : true, + maxLength : 255, validation : function () { return true; } }).on ('changing', function (input, value) { me.updateControls(); @@ -216,7 +218,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template', simpleAddMode: false, template: _.template(['
'].join('')), itemTemplate: _.template([ - '
<%= value %>
' + '
<%= value %>
' ].join('')), scrollAlwaysVisible: true }); @@ -226,6 +228,7 @@ define([ 'text!common/main/lib/template/AutoCorrectDialog.template', el : $window.find('#auto-correct-rec-find'), allowBlank : true, validateOnChange : true, + maxLength : 255, validation : function () { return true; } }).on ('changing', function (input, value) { var _selectedItem; diff --git a/apps/documenteditor/main/app/view/CrossReferenceDialog.js b/apps/documenteditor/main/app/view/CrossReferenceDialog.js index 5cb66b21e..f2a436813 100644 --- a/apps/documenteditor/main/app/view/CrossReferenceDialog.js +++ b/apps/documenteditor/main/app/view/CrossReferenceDialog.js @@ -203,7 +203,7 @@ define([ var me = this; var onApiEndCalculate = function() { - me.refreshReferences(me.cmbType.getSelectedRecord()); + me.refreshReferences(me.cmbType.getSelectedRecord(), true); }; this.api.asc_registerCallback('asc_onEndCalculate', onApiEndCalculate); this.on('close', function(obj){ @@ -361,13 +361,16 @@ define([ this.refreshReferences(record); }, - refreshReferences: function(record) { + refreshReferences: function(record, reselect) { if (!record) return; var store = this.refList.store, type = (record.type==1 || record.value > 4) ? 5 : record.value, arr = [], - props; + props, + oldlength = store.length, + oldidx = _.indexOf(store.models, this.refList.getSelectedRec()); + switch (type) { case 0: // paragraph props = this.api.asc_GetAllNumberedParagraphs(); @@ -404,7 +407,7 @@ define([ store.reset(arr); if (store.length>0) { - var rec = store.at(0); + var rec = (reselect && store.length == oldlength && oldidx>=0 && oldidx