diff --git a/apps/common/main/lib/component/ComboBorderSize.js b/apps/common/main/lib/component/ComboBorderSize.js
index c6994b233..422679d0a 100644
--- a/apps/common/main/lib/component/ComboBorderSize.js
+++ b/apps/common/main/lib/component/ComboBorderSize.js
@@ -75,7 +75,6 @@ define([
});
Common.UI.ComboBorderSize = Common.UI.ComboBox.extend(_.extend({
- allowNoBorders: true,
template: _.template([
'
',
'
',
@@ -105,7 +104,7 @@ define([
{displayValue: '4.5 ' + txtPt, value: 4.5, pxValue: 5, offsety: 100},
{displayValue: '6 ' + txtPt, value: 6, pxValue: 6, offsety: 120}
];
- if (options.allowNoBorders)
+ if (options.allowNoBorders !== false)
data.unshift({displayValue: this.txtNoBorders, value: 0, pxValue: 0 });
Common.UI.ComboBox.prototype.initialize.call(this, _.extend({
@@ -192,13 +191,8 @@ define([
initialize : function(options) {
this.txtNoBorders = options.txtNoBorders || this.txtNoBorders;
- var txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
-
- Common.UI.ComboBox.prototype.initialize.call(this, _.extend({
- editable: true,
- store: new Common.UI.BordersStore(),
- data: [
- {displayValue: this.txtNoBorders, value: 0, pxValue: 0 },
+ var txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt),
+ data = [
{displayValue: '0.5 ' + txtPt, value: 0.5, pxValue: 0.5, offsety: 0},
{displayValue: '1 ' + txtPt, value: 1, pxValue: 1, offsety: 20},
{displayValue: '1.5 ' + txtPt, value: 1.5, pxValue: 2, offsety: 40},
@@ -206,7 +200,15 @@ define([
{displayValue: '3 ' + txtPt, value: 3, pxValue: 4, offsety: 80},
{displayValue: '4.5 ' + txtPt, value: 4.5, pxValue: 5, offsety: 100},
{displayValue: '6 ' + txtPt, value: 6, pxValue: 6, offsety: 120}
- ],
+ ];
+
+ if (options.allowNoBorders !== false)
+ data.unshift({displayValue: this.txtNoBorders, value: 0, pxValue: 0 });
+
+ Common.UI.ComboBox.prototype.initialize.call(this, _.extend({
+ editable: true,
+ store: new Common.UI.BordersStore(),
+ data: data,
menuStyle: 'min-width: 150px;'
}, options));
},
diff --git a/apps/spreadsheeteditor/main/app/view/ChartSettings.js b/apps/spreadsheeteditor/main/app/view/ChartSettings.js
index e646f5550..eeaeaae97 100644
--- a/apps/spreadsheeteditor/main/app/view/ChartSettings.js
+++ b/apps/spreadsheeteditor/main/app/view/ChartSettings.js
@@ -65,6 +65,7 @@ define([
initialize: function () {
this._initSettings = true;
+ this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt);
this._state = {
Width: 0,
@@ -233,12 +234,13 @@ define([
}
});
if (_selectedItem)
- this.cmbBorderSize.setValue(_selectedItem.get('value'));
+ this.cmbBorderSize.selectRecord(_selectedItem);
else {
this.cmbBorderSize.setValue((w!==null) ? parseFloat(w.toFixed(2)) + ' ' + this.txtPt : '');
}
this.BorderSize = w;
}
+ this.cmbBorderSize.setDisabled(this._locked || this._state.SparkType!==Asc.c_oAscSparklineType.Line);
var color = props.asc_getColorSeries();
if (color) {
@@ -793,10 +795,10 @@ define([
this.mnuSparkStylePicker.on('item:click', _.bind(this.onSelectSparkStyle, this, this.btnSparkStyle));
this.lockedControls.push(this.btnSparkStyle);
- this.cmbBorderSize = new Common.UI.ComboBorderSize({
+ this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({
el : $('#spark-combo-line-type'),
style : 'width: 90px;',
- hasNoBorders: false
+ allowNoBorders: false
}).on('selected', _.bind(this.onBorderSizeSelect, this));
this.BorderSize = this.cmbBorderSize.store.at(1).get('value');
this.cmbBorderSize.setValue(this.BorderSize);