' +
'<% var me = this; %>' +
'<% $(colors).each(function(num, item) { %>' +
'<% if (me.isBlankSeparator(item)) { %>
' +
diff --git a/apps/common/main/lib/controller/History.js b/apps/common/main/lib/controller/History.js
index b261bc3a5..b3714940d 100644
--- a/apps/common/main/lib/controller/History.js
+++ b/apps/common/main/lib/controller/History.js
@@ -139,6 +139,12 @@ define([
Common.Gateway.requestHistoryData(rev); // получаем url-ы для ревизий
}, 10);
} else {
+ var commentsController = this.getApplication().getController('Common.Controllers.Comments');
+ if (commentsController) {
+ commentsController.onApiHideComment();
+ commentsController.clearCollections();
+ }
+
var urlDiff = record.get('urlDiff'),
token = record.get('token'),
hist = new Asc.asc_CVersionHistory();
@@ -152,11 +158,6 @@ define([
hist.asc_setServerVersion(this.currentServerVersion);
this.api.asc_showRevision(hist);
- var commentsController = this.getApplication().getController('Common.Controllers.Comments');
- if (commentsController) {
- commentsController.onApiHideComment();
- commentsController.clearCollections();
- }
var reviewController = this.getApplication().getController('Common.Controllers.ReviewChanges');
if (reviewController)
reviewController.onApiShowChange();
@@ -175,6 +176,12 @@ define([
};
Common.UI.alert(config);
} else {
+ var commentsController = this.getApplication().getController('Common.Controllers.Comments');
+ if (commentsController) {
+ commentsController.onApiHideComment();
+ commentsController.clearCollections();
+ }
+
var data = opts.data;
var historyStore = this.getApplication().getCollection('Common.Collections.HistoryVersions');
if (historyStore && data!==null) {
@@ -210,11 +217,6 @@ define([
hist.asc_setServerVersion(this.currentServerVersion);
this.api.asc_showRevision(hist);
- var commentsController = this.getApplication().getController('Common.Controllers.Comments');
- if (commentsController) {
- commentsController.onApiHideComment();
- commentsController.clearCollections();
- }
var reviewController = this.getApplication().getController('Common.Controllers.ReviewChanges');
if (reviewController)
reviewController.onApiShowChange();
diff --git a/apps/common/main/lib/template/AutoCorrectDialog.template b/apps/common/main/lib/template/AutoCorrectDialog.template
index 872521c14..6aa2fcc25 100644
--- a/apps/common/main/lib/template/AutoCorrectDialog.template
+++ b/apps/common/main/lib/template/AutoCorrectDialog.template
@@ -25,9 +25,9 @@
diff --git a/apps/common/main/lib/view/OpenDialog.js b/apps/common/main/lib/view/OpenDialog.js
index 659d4b7df..6123d15f5 100644
--- a/apps/common/main/lib/view/OpenDialog.js
+++ b/apps/common/main/lib/view/OpenDialog.js
@@ -68,6 +68,7 @@ define([
preview : options.preview,
warning : options.warning,
codepages : options.codepages,
+ warningMsg : options.warningMsg,
width : width,
height : height,
header : true,
@@ -85,7 +86,7 @@ define([
'<% if (warning) { %>',
'
',
'
',
- '
' + t.txtProtected+ '
',
+ '
' + (typeof _options.warningMsg=='string' ? _options.warningMsg : t.txtProtected) + '
',
'',
'
',
'
',
diff --git a/apps/common/main/lib/view/SymbolTableDialog.js b/apps/common/main/lib/view/SymbolTableDialog.js
index 8b0e97407..f95f03d1e 100644
--- a/apps/common/main/lib/view/SymbolTableDialog.js
+++ b/apps/common/main/lib/view/SymbolTableDialog.js
@@ -800,13 +800,16 @@ define([
},
getPasteSymbol: function(cellId) {
- var bUpdateRecents = cellId[0] === 'c';
+ var bUpdateRecents = false;
var sFont;
- if(bUpdateRecents){
- sFont = aFontSelects[nCurrentFont].displayValue;
- } else {
- var nFontId = parseInt(cellId.split('_')[2]);
- sFont = aFontSelects[nFontId].displayValue;
+ if (cellId && cellId.length>0) {
+ bUpdateRecents = (cellId[0] === 'c');
+ if(bUpdateRecents){
+ sFont = aFontSelects[nCurrentFont].displayValue;
+ } else {
+ var nFontId = parseInt(cellId.split('_')[2]);
+ sFont = aFontSelects[nFontId].displayValue;
+ }
}
return {font: sFont, symbol: this.encodeSurrogateChar(nCurrentSymbol), code: nCurrentSymbol, updateRecents: bUpdateRecents};
},
@@ -831,7 +834,7 @@ define([
}
var special = this.btnSpecial.isActive();
- var settings = special ? this.getSpecialSymbol() : this.getPasteSymbol(this.$window.find('.cell-selected').attr('id'));
+ var settings = (state=='ok') ? (special ? this.getSpecialSymbol() : this.getPasteSymbol(this.$window.find('.cell-selected').attr('id'))) : {};
if (this.options.handler) {
this.options.handler.call(this, this, state, settings);
}
diff --git a/apps/common/main/resources/img/controls/common-controls.png b/apps/common/main/resources/img/controls/common-controls.png
index 8694bd120..03fb0999d 100755
Binary files a/apps/common/main/resources/img/controls/common-controls.png and b/apps/common/main/resources/img/controls/common-controls.png differ
diff --git a/apps/common/main/resources/img/controls/common-controls@1.5x.png b/apps/common/main/resources/img/controls/common-controls@1.5x.png
index 1d29d593f..1fd7da019 100644
Binary files a/apps/common/main/resources/img/controls/common-controls@1.5x.png and b/apps/common/main/resources/img/controls/common-controls@1.5x.png differ
diff --git a/apps/common/main/resources/img/controls/common-controls@2x.png b/apps/common/main/resources/img/controls/common-controls@2x.png
index 1c1de5bcb..7d368d53e 100755
Binary files a/apps/common/main/resources/img/controls/common-controls@2x.png and b/apps/common/main/resources/img/controls/common-controls@2x.png differ
diff --git a/apps/common/main/resources/less/asc-mixins.less b/apps/common/main/resources/less/asc-mixins.less
index c7e8a6d22..5f3f0311e 100644
--- a/apps/common/main/resources/less/asc-mixins.less
+++ b/apps/common/main/resources/less/asc-mixins.less
@@ -200,7 +200,7 @@
@common-controls-width: 100px;
.img-commonctrl,
- .dropdown-menu li .checked:before, .input-error:before,
+ .dropdown-menu li .checked:before, .input-error:before, .input-warning:before,
.btn-toolbar .icon.img-commonctrl, .list-item div.checked:before
{
background-image: if(@icon-src-base64, data-uri(%("%s",'@{common-image-path}/@{common-controls}')), ~"url(@{common-image-const-path}/@{common-controls})");
diff --git a/apps/common/main/resources/less/input.less b/apps/common/main/resources/less/input.less
index ae0c3328a..4fcbd8755 100644
--- a/apps/common/main/resources/less/input.less
+++ b/apps/common/main/resources/less/input.less
@@ -61,6 +61,18 @@
display: block;
}
}
+
+ &.warning {
+ input:not([disabled]) + .input-error {
+ display: block;
+ }
+
+ .input-error {
+ &:before {
+ background-position: @input-warning-offset-x @input-warning-offset-y;
+ }
+ }
+ }
}
input:required:focus:invalid,
diff --git a/apps/common/main/resources/less/variables.less b/apps/common/main/resources/less/variables.less
index 044f6cbc4..04878d790 100644
--- a/apps/common/main/resources/less/variables.less
+++ b/apps/common/main/resources/less/variables.less
@@ -771,6 +771,10 @@
@input-error-offset-x: -73px;
@input-error-offset-y: -170px;
+// Input warning
+@input-warning-offset-x: -57px;
+@input-warning-offset-y: -170px;
+
// Spinner
@spinner-offset-x: -41px;
@spinner-offset-y: -187px;
diff --git a/apps/common/mobile/lib/controller/Collaboration.js b/apps/common/mobile/lib/controller/Collaboration.js
index 699d94a15..9d6257245 100644
--- a/apps/common/mobile/lib/controller/Collaboration.js
+++ b/apps/common/mobile/lib/controller/Collaboration.js
@@ -408,6 +408,7 @@ define([
}
!suppressEvent && this.initReviewingSettingsView();
DE.getController('Toolbar').setDisplayMode(displayMode);
+ DE.getController('DocumentHolder').setDisplayMode(displayMode);
},
@@ -853,7 +854,7 @@ define([
}
} else {
$('.comment-resolve, .comment-menu, .add-reply, .reply-menu').removeClass('disabled');
- if (this.showComments.length > 1) {
+ if (this.showComments && this.showComments.length > 1) {
$('.prev-comment, .next-comment').removeClass('disabled');
}
}
@@ -865,7 +866,7 @@ define([
$('.comment-menu').single('click', _.buffered(this.initMenuComments, 100, this));
$('.reply-menu').single('click', _.buffered(this.initReplyMenu, 100, this));
$('.comment-resolve').single('click', _.bind(this.onClickResolveComment, this, false));
- if (this.showComments.length === 1) {
+ if (this.showComments && this.showComments.length === 1) {
$('.prev-comment, .next-comment').addClass('disabled');
}
},
@@ -923,7 +924,7 @@ define([
$('.reply-menu').single('click', _.buffered(me.initReplyMenu, 100, me));
$('.comment-resolve').single('click', _.bind(me.onClickResolveComment, me, false));
- if (me.showComments.length === 1) {
+ if (me.showComments && me.showComments.length === 1) {
$('.prev-comment, .next-comment').addClass('disabled');
}
@@ -1000,7 +1001,7 @@ define([
},
onViewPrevComment: function() {
- if (this.showComments.length > 0) {
+ if (this.showComments && this.showComments.length > 0) {
if (this.indexCurrentComment - 1 < 0) {
this.indexCurrentComment = this.showComments.length - 1;
} else {
@@ -1017,7 +1018,7 @@ define([
},
onViewNextComment: function() {
- if (this.showComments.length > 0) {
+ if (this.showComments && this.showComments.length > 0) {
if (this.indexCurrentComment + 1 === this.showComments.length) {
this.indexCurrentComment = 0;
} else {
diff --git a/apps/documenteditor/main/app/controller/FormsTab.js b/apps/documenteditor/main/app/controller/FormsTab.js
index 8869661fd..28e15d94d 100644
--- a/apps/documenteditor/main/app/controller/FormsTab.js
+++ b/apps/documenteditor/main/app/controller/FormsTab.js
@@ -69,7 +69,6 @@ define([
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
this.api.asc_registerCallback('asc_onChangeSpecialFormsGlobalSettings', _.bind(this.onChangeSpecialFormsGlobalSettings, this));
- this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, this));
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
// this.api.asc_registerCallback('asc_onShowContentControlsActions',_.bind(this.onShowContentControlsActions, this));
@@ -90,7 +89,6 @@ define([
'forms:clear': this.onClearClick,
'forms:no-color': this.onNoControlsColor,
'forms:select-color': this.onSelectControlsColor,
- 'forms:open-color': this.onColorsShow,
'forms:mode': this.onModeClick
}
});
@@ -145,36 +143,6 @@ define([
}
},
- onSendThemeColors: function() {
- this._needUpdateColors = true;
- },
-
- updateThemeColors: function() {
- var updateColors = function(picker, defaultColorIndex) {
- if (picker) {
- var clr;
-
- var effectcolors = Common.Utils.ThemeColor.getEffectColors();
- for (var i = 0; i < effectcolors.length; i++) {
- if (typeof(picker.currentColor) == 'object' &&
- clr === undefined &&
- picker.currentColor.effectId == effectcolors[i].effectId)
- clr = effectcolors[i];
- }
-
- picker.updateColors(effectcolors, Common.Utils.ThemeColor.getStandartColors());
- if (picker.currentColor === undefined) {
- picker.currentColor = effectcolors[defaultColorIndex];
- } else if ( clr!==undefined ) {
- picker.currentColor = clr;
- }
- }
- };
-
- this.view && this.view.mnuFormsColorPicker && updateColors(this.view.mnuFormsColorPicker, 1);
- this.onChangeSpecialFormsGlobalSettings();
- },
-
onChangeSpecialFormsGlobalSettings: function() {
if (this.view && this.view.mnuFormsColorPicker) {
var clr = this.api.asc_GetSpecialFormsHighlightColor(),
@@ -190,11 +158,6 @@ define([
}
},
- onColorsShow: function(menu) {
- this._needUpdateColors && this.updateThemeColors();
- this._needUpdateColors = false;
- },
-
onControlsSelect: function(type) {
if (!(this.toolbar.mode && this.toolbar.mode.canFeatureContentControl)) return;
diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js
index 9f7c1be1e..19707e2f5 100644
--- a/apps/documenteditor/main/app/controller/Main.js
+++ b/apps/documenteditor/main/app/controller/Main.js
@@ -2143,6 +2143,7 @@ define([
closeFile: me.appOptions.canRequestClose,
type: Common.Utils.importTextType.DRM,
warning: !(me.appOptions.isDesktopApp && me.appOptions.isOffline),
+ warningMsg: advOptions,
validatePwd: !!me._state.isDRM,
handler: function (result, value) {
me.isShowOpenDialog = false;
diff --git a/apps/documenteditor/main/app/controller/RightMenu.js b/apps/documenteditor/main/app/controller/RightMenu.js
index 1207e25d3..1993b7c48 100644
--- a/apps/documenteditor/main/app/controller/RightMenu.js
+++ b/apps/documenteditor/main/app/controller/RightMenu.js
@@ -321,7 +321,6 @@ define([
this.rightmenu.tableSettings.UpdateThemeColors();
this.rightmenu.shapeSettings.UpdateThemeColors();
this.rightmenu.textartSettings.UpdateThemeColors();
- this.rightmenu.formSettings && this.rightmenu.formSettings.UpdateThemeColors();
},
updateMetricUnit: function() {
diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js
index d959ba97f..d9f56f2c4 100644
--- a/apps/documenteditor/main/app/controller/Toolbar.js
+++ b/apps/documenteditor/main/app/controller/Toolbar.js
@@ -1015,13 +1015,13 @@ define([
onChangeSdtGlobalSettings: function() {
var show = this.api.asc_GetGlobalContentControlShowHighlight();
- this.toolbar.mnuNoControlsColor.setChecked(!show, true);
- this.toolbar.mnuControlsColorPicker.clearSelection();
+ this.toolbar.mnuNoControlsColor && this.toolbar.mnuNoControlsColor.setChecked(!show, true);
+ this.toolbar.mnuControlsColorPicker && this.toolbar.mnuControlsColorPicker.clearSelection();
if (show){
var clr = this.api.asc_GetGlobalContentControlHighlightColor();
if (clr) {
clr = Common.Utils.ThemeColor.getHexColor(clr.get_r(), clr.get_g(), clr.get_b());
- this.toolbar.mnuControlsColorPicker.selectByRGB(clr, true);
+ this.toolbar.mnuControlsColorPicker && this.toolbar.mnuControlsColorPicker.selectByRGB(clr, true);
}
}
},
@@ -2862,9 +2862,6 @@ define([
this.onParagraphColor(this._state.clrshd_asccolor);
}
this._state.clrshd_asccolor = undefined;
-
- updateColors(this.toolbar.mnuControlsColorPicker, 1);
- this.onChangeSdtGlobalSettings();
},
_onInitEditorStyles: function(styles) {
@@ -3107,6 +3104,7 @@ define([
me.toolbar.addTab(tab, $panel, 4);
me.toolbar.setVisible('forms', true);
Array.prototype.push.apply(me.toolbar.toolbarControls, forms.getView('FormsTab').getButtons());
+ me.onChangeSdtGlobalSettings();
}
}
},
diff --git a/apps/documenteditor/main/app/template/ChartSettings.template b/apps/documenteditor/main/app/template/ChartSettings.template
index b4d293b9a..41d89483b 100644
--- a/apps/documenteditor/main/app/template/ChartSettings.template
+++ b/apps/documenteditor/main/app/template/ChartSettings.template
@@ -54,7 +54,7 @@
- <%= scope.textEditData %>
+ <%= scope.textEditData %>
diff --git a/apps/documenteditor/main/app/view/ControlSettingsDialog.js b/apps/documenteditor/main/app/view/ControlSettingsDialog.js
index 863793b91..db0d6c3f2 100644
--- a/apps/documenteditor/main/app/view/ControlSettingsDialog.js
+++ b/apps/documenteditor/main/app/view/ControlSettingsDialog.js
@@ -137,7 +137,13 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
},
{caption: '--'}],
additionalAlign: this.menuAddAlign,
- color: '000000'
+ color: '000000',
+ colors: ['000000', '993300', '333300', '003300', '003366', '000080', '333399', '333333', '800000', 'FF6600',
+ '808000', '00FF00', '008080', '0000FF', '666699', '808080', 'FF0000', 'FF9900', '99CC00', '339966',
+ '33CCCC', '3366FF', '800080', '999999', 'FF00FF', 'FFCC00', 'FFFF00', '00FF00', '00FFFF', '00CCFF',
+ '993366', 'C0C0C0', 'FF99CC', 'FFCC99', 'FFFF99', 'CCFFCC', 'CCFFFF', '99CCFF', 'CC99FF', 'FFFFFF'
+ ],
+ paletteHeight: 94
});
this.btnColor.on('color:select', _.bind(this.onColorsSelect, this));
this.colors = this.btnColor.getPicker();
@@ -381,10 +387,6 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
this.isSystemColor = false;
},
- updateThemeColors: function() {
- this.colors.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
- },
-
onSystemColor: function(e) {
var color = Common.Utils.ThemeColor.getHexColor(220, 220, 220);
this.btnColor.setColor(color);
@@ -395,7 +397,6 @@ define([ 'text!documenteditor/main/app/template/ControlSettingsDialog.template',
},
afterRender: function() {
- this.updateThemeColors();
this.updateMetricUnit();
this._setDefaults(this.props);
if (this.storageName) {
diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js
index 546f4b9bd..ae8bd17d0 100644
--- a/apps/documenteditor/main/app/view/DocumentHolder.js
+++ b/apps/documenteditor/main/app/view/DocumentHolder.js
@@ -1880,7 +1880,7 @@ define([
}
})).show();
} else if (item.value == 'remove') {
- this.api.asc_RemoveContentControlWrapper(props.get_InternalId());
+ props.get_FormPr() ? this.api.asc_RemoveContentControl(props.get_InternalId()) : this.api.asc_RemoveContentControlWrapper(props.get_InternalId());
}
}
me.fireEvent('editcomplete', me);
@@ -3330,7 +3330,6 @@ define([
menu : new Common.UI.Menu({
cls: 'shifted-right',
menuAlign: 'tl-tr',
- style : 'width: 100px',
items : [
new Common.UI.MenuItem({
caption: me.insertColumnLeftText
@@ -4353,6 +4352,10 @@ define([
return;
}
this.api.asc_addImage(obj);
+ var me = this;
+ setTimeout(function(){
+ me.api.asc_UncheckContentControlButtons();
+ }, 500);
break;
case Asc.c_oAscContentControlSpecificType.DropDownList:
case Asc.c_oAscContentControlSpecificType.ComboBox:
diff --git a/apps/documenteditor/main/app/view/FormSettings.js b/apps/documenteditor/main/app/view/FormSettings.js
index c46df84f4..f579d2789 100644
--- a/apps/documenteditor/main/app/view/FormSettings.js
+++ b/apps/documenteditor/main/app/view/FormSettings.js
@@ -185,6 +185,7 @@ define([
minValue: 0.1
});
this.lockedControls.push(this.spnWidth);
+ this.spinners.push(this.spnWidth);
this.spnWidth.on('change', this.onWidthChange.bind(this));
this.spnWidth.on('inputleave', function(){ me.fireEvent('editcomplete', me);});
@@ -212,8 +213,8 @@ define([
value : ''
});
this.lockedControls.push(this.txtNewValue);
- this.txtNewValue.on('changed:after', this.onAddItem.bind(this));
this.txtNewValue.on('inputleave', function(){ me.fireEvent('editcomplete', me);});
+ this.txtNewValue._input.on('keydown', _.bind(this.onNewValueKeydown, this));
this.list = new Common.UI.ListView({
el: $markup.findById('#form-list-list'),
@@ -294,7 +295,7 @@ define([
style : 'text-align: left;'
});
this.btnRemForm.on('click', _.bind(function(btn){
- this.api.asc_RemoveContentControlWrapper(this._state.id);
+ this.api.asc_RemoveContentControl(this._state.id);
}, this));
this.lockedControls.push(this.btnRemForm);
@@ -341,22 +342,24 @@ define([
},
onPlaceholderChanged: function(input, newValue, oldValue, e) {
- if (this.api && !this._noApply) {
+ if (this.api && !this._noApply && (newValue!==oldValue)) {
var props = this._originalProps || new AscCommon.CContentControlPr();
props.put_PlaceholderText(newValue || ' ');
this.api.asc_SetContentControlProperties(props, this.internalId);
- this.fireEvent('editcomplete', this);
+ if (!e.relatedTarget || (e.relatedTarget.localName != 'input' && e.relatedTarget.localName != 'textarea') || !/form-control/.test(e.relatedTarget.className))
+ this.fireEvent('editcomplete', this);
}
},
onHelpChanged: function(input, newValue, oldValue, e) {
- if (this.api && !this._noApply) {
+ if (this.api && !this._noApply && (newValue!==oldValue)) {
var props = this._originalProps || new AscCommon.CContentControlPr();
var formPr = this._originalFormProps || new AscCommon.CSdtFormPr();
formPr.put_HelpText(newValue);
props.put_FormPr(formPr);
this.api.asc_SetContentControlProperties(props, this.internalId);
- this.fireEvent('editcomplete', this);
+ if (!e.relatedTarget || (e.relatedTarget.localName != 'input' && e.relatedTarget.localName != 'textarea') || !/form-control/.test(e.relatedTarget.className))
+ this.fireEvent('editcomplete', this);
}
},
@@ -405,7 +408,7 @@ define([
formTextPr.put_MaxCharacters(this.spnMaxChars.getNumberValue() || 10);
if (this.spnWidth.getValue()) {
var value = this.spnWidth.getNumberValue();
- formTextPr.put_Width(value<=0 ? 0 : parseInt(Common.Utils.Metric.fnRecalcToMM(value) * 72 * 20 / 25.4));
+ formTextPr.put_Width(value<=0 ? 0 : parseInt(Common.Utils.Metric.fnRecalcToMM(value) * 72 * 20 / 25.4 + 0.1));
} else
formTextPr.put_Width(0);
}
@@ -421,7 +424,7 @@ define([
var formTextPr = this._originalTextFormProps || new AscCommon.CSdtTextFormPr();
if (this.spnWidth.getValue()) {
var value = this.spnWidth.getNumberValue();
- formTextPr.put_Width(value<=0 ? 0 : parseInt(Common.Utils.Metric.fnRecalcToMM(value) * 72 * 20 / 25.4));
+ formTextPr.put_Width(value<=0 ? 0 : parseInt(Common.Utils.Metric.fnRecalcToMM(value) * 72 * 20 / 25.4 + 0.1));
} else
formTextPr.put_Width(0);
@@ -455,6 +458,12 @@ define([
}
},
+ onNewValueKeydown: function(event) {
+ if (this.api && !this._noApply && event.keyCode == Common.UI.Keys.RETURN) {
+ this.onAddItem();
+ }
+ },
+
onAddItem: function() {
var store = this.list.store,
value = this.txtNewValue.getValue();
@@ -533,7 +542,7 @@ define([
onColorPickerSelect: function(btn, color) {
this.BorderColor = color;
- this._state.BorderColor = this.BorderColor;
+ this._state.BorderColor = undefined;
if (this.api && !this._noApply) {
var props = this._originalProps || new AscCommon.CContentControlPr();
@@ -554,6 +563,20 @@ define([
}
},
+ onNoBorderClick: function(item) {
+ this.BorderColor = 'transparent';
+ this._state.BorderColor = undefined;
+
+ if (this.api && !this._noApply) {
+ var props = this._originalProps || new AscCommon.CContentControlPr();
+ var formTextPr = this._originalTextFormProps || new AscCommon.CSdtTextFormPr();
+ formTextPr.put_CombBorder();
+ props.put_TextFormPr(formTextPr);
+ this.api.asc_SetContentControlProperties(props, this.internalId);
+ this.fireEvent('editcomplete', this);
+ }
+ },
+
ChangeSettings: function(props) {
if (this._initSettings)
this.createDelayedElements();
@@ -631,14 +654,20 @@ define([
this.labelFormName.text(this.textImage);
} else
data = this.api.asc_GetTextFormKeys();
- var arr = [];
- data.forEach(function(item) {
- arr.push({ displayValue: item, value: item });
- });
- this.cmbKey.setData(arr);
+ if (!this._state.arrKey || _.difference(this._state.arrKey, data).length>0) {
+ var arr = [];
+ data.forEach(function(item) {
+ arr.push({ displayValue: item, value: item });
+ });
+ this.cmbKey.setData(arr);
+ this._state.arrKey=data;
+ }
val = formPr.get_Key();
- this.cmbKey.setValue(val ? val : '');
+ if (this._state.Key!==val) {
+ this.cmbKey.setValue(val ? val : '');
+ this._state.Key=val;
+ }
if (val) {
val = this.api.asc_GetFormsCountByKey(val);
@@ -656,12 +685,20 @@ define([
val = specProps.get_GroupKey();
var ischeckbox = (typeof val !== 'string');
if (!ischeckbox) {
- var arr = [];
- this.api.asc_GetRadioButtonGroupKeys().forEach(function(item) {
- arr.push({ displayValue: item, value: item });
- });
- this.cmbGroupKey.setData(arr);
- this.cmbGroupKey.setValue(val ? val : '');
+ data = this.api.asc_GetRadioButtonGroupKeys();
+ if (!this._state.arrGroupKey || _.difference(this._state.arrGroupKey, data).length>0) {
+ var arr = [];
+ data.forEach(function(item) {
+ arr.push({ displayValue: item, value: item });
+ });
+ this.cmbGroupKey.setData(arr);
+ this._state.arrGroupKey=data;
+ }
+
+ if (this._state.groupKey!==val) {
+ this.cmbGroupKey.setValue(val ? val : '');
+ this._state.groupKey=val;
+ }
}
this.labelFormName.text(ischeckbox ? this.textCheckbox : this.textRadiobox);
@@ -697,7 +734,10 @@ define([
val = formTextPr.get_MaxCharacters();
this.chMaxChars.setValue(val && val>=0);
this.spnMaxChars.setDisabled(!val || val<0);
- this.spnMaxChars.setValue(val && val>=0 ? val : 10);
+ if ( (val===undefined || this._state.MaxChars===undefined)&&(this._state.MaxChars!==val) || Math.abs(this._state.MaxChars-val)>0.1) {
+ this.spnMaxChars.setValue(val && val>=0 ? val : 10, true);
+ this._state.MaxChars=val;
+ }
var brd = formTextPr.get_CombBorder();
if (brd) {
@@ -721,7 +761,8 @@ define([
this.btnColor.setColor(this.BorderColor);
this.mnuColorPicker.clearSelection();
- this.mnuColorPicker.selectByRGB(typeof(this.BorderColor) == 'object' ? this.BorderColor.color : this.BorderColor,true);
+ this.mnuNoBorder.setChecked(this.BorderColor == 'transparent', true);
+ (this.BorderColor != 'transparent') && this.mnuColorPicker.selectByRGB(typeof(this.BorderColor) == 'object' ? this.BorderColor.color : this.BorderColor,true);
this._state.BorderColor = this.BorderColor;
}
}
@@ -743,8 +784,11 @@ define([
for (var i=0; i