diff --git a/apps/documenteditor/main/app/controller/RightMenu.js b/apps/documenteditor/main/app/controller/RightMenu.js
index baac421e7..01f508e3e 100644
--- a/apps/documenteditor/main/app/controller/RightMenu.js
+++ b/apps/documenteditor/main/app/controller/RightMenu.js
@@ -321,6 +321,7 @@ define([
this.rightmenu.tableSettings.UpdateThemeColors();
this.rightmenu.shapeSettings.UpdateThemeColors();
this.rightmenu.textartSettings.UpdateThemeColors();
+ this.rightmenu.formSettings.UpdateThemeColors();
},
updateMetricUnit: function() {
diff --git a/apps/documenteditor/main/app/template/FormSettings.template b/apps/documenteditor/main/app/template/FormSettings.template
index a2762b47e..b87b2e27e 100644
--- a/apps/documenteditor/main/app/template/FormSettings.template
+++ b/apps/documenteditor/main/app/template/FormSettings.template
@@ -113,6 +113,12 @@
+
+ |
+
+
+ |
+
diff --git a/apps/documenteditor/main/app/view/FormSettings.js b/apps/documenteditor/main/app/view/FormSettings.js
index a997eaace..1c6afaef2 100644
--- a/apps/documenteditor/main/app/view/FormSettings.js
+++ b/apps/documenteditor/main/app/view/FormSettings.js
@@ -659,6 +659,26 @@ define([
}
},
+ onColorBGSelect: function(btn, color) {
+ this.BackgroundColor = color;
+ this._state.BackgroundColor = undefined;
+
+ var props = this._originalProps || new AscCommon.CContentControlPr();
+ var formPr = this._originalFormProps || new AscCommon.CSdtFormPr();
+
+ if (this.api) {
+ if (color === 'transparent') {
+ formPr.put_Shd(false);
+ } else {
+ formPr.put_Shd(true, Common.Utils.ThemeColor.getRgbColor(color));
+ }
+ props.put_FormPr(formPr);
+ this.api.asc_SetContentControlProperties(props, this.internalId);
+ }
+
+ this.fireEvent('editcomplete', this);
+ },
+
onColorPickerSelect: function(btn, color) {
this.BorderColor = color;
this._state.BorderColor = undefined;
@@ -863,6 +883,45 @@ define([
(this.BorderColor != 'transparent') && this.mnuColorPicker.selectByRGB(typeof(this.BorderColor) == 'object' ? this.BorderColor.color : this.BorderColor,true);
this._state.BorderColor = this.BorderColor;
}
+
+ var shd = formPr.get_Shd();
+ if (shd) {
+ var bgColor = shd.get_Color();
+ if (bgColor) {
+ if (bgColor.get_type() === Asc.c_oAscColor.COLOR_TYPE_SCHEME) {
+ this.BackgroundColor = {color: Common.Utils.ThemeColor.getHexColor(bgColor.get_r(), bgColor.get_g(), bgColor.get_b()), effectValue: bgColor.get_value() };
+ } else {
+ this.BackgroundColor = Common.Utils.ThemeColor.getHexColor(bgColor.get_r(), bgColor.get_g(), bgColor.get_b());
+ }
+ } else
+ this.BackgroundColor = 'transparent';
+ } else {
+ this.BackgroundColor = 'transparent';
+ }
+
+ type1 = typeof(this.BackgroundColor);
+ type2 = typeof(this._state.BackgroundColor);
+ if ( (type1 !== type2) || (type1 === 'object' &&
+ (this.BackgroundColor.effectValue!==this._state.BackgroundColor.effectValue || this._state.BackgroundColor.color.indexOf(this.BackgroundColor.color)<0)) ||
+ (type1 !== 'object' && this._state.BackgroundColor.indexOf(this.BackgroundColor)<0 )) {
+
+ this.btnBGColor.setColor(this.BackgroundColor);
+ if ( typeof(this.BackgroundColor) == 'object' ) {
+ var isselected = false;
+ for (i=0; i<10; i++) {
+ if ( Common.Utils.ThemeColor.ThemeValues[i] === this.BackgroundColor.effectValue ) {
+ this.mnuBGColorPicker.select(this.BackgroundColor, true);
+ isselected = true;
+ break;
+ }
+ }
+ if (!isselected) this.mnuBGColorPicker.clearSelection();
+ } else
+ this.mnuBGColorPicker.select(this.BackgroundColor,true);
+
+ this._state.BackgroundColor = this.BackgroundColor;
+ }
+
}
var pictPr = props.get_PictureFormPr();
@@ -980,6 +1039,18 @@ define([
this.btnColor.setMenu();
this.mnuColorPicker = this.btnColor.getPicker();
}
+ if (!this.btnBGColor) {
+ this.btnBGColor = new Common.UI.ColorButton({
+ parentEl: $('#form-background-color-btn'),
+ transparent: true,
+ menu: true
+ });
+ this.lockedControls.push(this.btnBGColor);
+ this.btnBGColor.on('color:select', _.bind(this.onColorBGSelect, this));
+ this.btnBGColor.setMenu();
+ this.mnuBGColorPicker = this.btnBGColor.getPicker();
+ }
+ this.mnuBGColorPicker.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
},
onHideMenus: function(menu, e, isFromInputControl){
@@ -1090,7 +1161,8 @@ define([
textNever: 'Never',
textTooBig: 'Image is Too Big',
textTooSmall: 'Image is Too Small',
- textScale: 'When to scale'
+ textScale: 'When to scale',
+ textBackgroundColor: 'Background Color'
}, DE.Views.FormSettings || {}));
});
\ No newline at end of file
diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json
index 9c33f4a6b..280ac3b03 100644
--- a/apps/documenteditor/main/locale/en.json
+++ b/apps/documenteditor/main/locale/en.json
@@ -1776,6 +1776,7 @@
"DE.Views.FormSettings.textUnlock": "Unlock",
"DE.Views.FormSettings.textValue": "Value Options",
"DE.Views.FormSettings.textWidth": "Cell width",
+ "DE.Views.FormSettings.textBackgroundColor": "Background Color",
"DE.Views.FormsTab.capBtnCheckBox": "Checkbox",
"DE.Views.FormsTab.capBtnComboBox": "Combo Box",
"DE.Views.FormsTab.capBtnDropDown": "Dropdown",