diff --git a/apps/presentationeditor/main/app/view/ChartSettings.js b/apps/presentationeditor/main/app/view/ChartSettings.js index ce4ef4150..bd6a5e601 100644 --- a/apps/presentationeditor/main/app/view/ChartSettings.js +++ b/apps/presentationeditor/main/app/view/ChartSettings.js @@ -474,6 +474,7 @@ define([ }); this.lockedControls.push(this.chRightAngle); this.chRightAngle.on('change', _.bind(function(field, newValue, oldValue, eOpts) { + if (this._noApply) return; if (this.api){ if (this.chartProps) { var props = new Asc.CAscChartProp(); @@ -494,6 +495,7 @@ define([ }); this.lockedControls.push(this.chAutoscale); this.chAutoscale.on('change', _.bind(function(field, newValue, oldValue, eOpts) { + if (this._noApply) return; if (this.api){ if (this.chartProps) { var props = new Asc.CAscChartProp(); @@ -794,91 +796,98 @@ define([ }, onXRotation: function(field, newValue, oldValue, eOpts){ + if (this._noApply) return; if (this.api){ - var props = this.api.asc_getChartObject(); - if (props) { - var oView3D = props.getView3d(); + if (this.chartProps) { + var props = new Asc.CAscChartProp(); + var oView3D = this.chartProps.getView3d(); if (oView3D) { oView3D.asc_setRotX(field.getNumberValue()); - props.startEdit(); - props.setView3d(oView3D); - props.endEdit(); + this.chartProps.putView3d(oView3D); + props.put_ChartProperties(this.chartProps); + this.api.ChartApply(props); } } } }, onYRotation: function(field, newValue, oldValue, eOpts){ + if (this._noApply) return; if (this.api){ - var props = this.api.asc_getChartObject(); - if (props) { - var oView3D = props.getView3d(); + if (this.chartProps) { + var props = new Asc.CAscChartProp(); + var oView3D = this.chartProps.getView3d(); if (oView3D) { oView3D.asc_setRotY(field.getNumberValue()); - props.startEdit(); - props.setView3d(oView3D); - props.endEdit(); + this.chartProps.putView3d(oView3D); + props.put_ChartProperties(this.chartProps); + this.api.ChartApply(props); } } } + }, onPerspective: function(field, newValue, oldValue, eOpts){ + if (this._noApply) return; if (this.api){ - var props = this.api.asc_getChartObject(); - if (props) { - var oView3D = props.getView3d(); + if (this.chartProps) { + var props = new Asc.CAscChartProp(); + var oView3D = this.chartProps.getView3d(); if (oView3D) { oView3D.asc_setPerspective(field.getNumberValue()); - props.startEdit(); - props.setView3d(oView3D); - props.endEdit(); + this.chartProps.putView3d(oView3D); + props.put_ChartProperties(this.chartProps); + this.api.ChartApply(props); } } } }, on3DDepth: function(field, newValue, oldValue, eOpts){ + if (this._noApply) return; if (this.api){ - var props = this.api.asc_getChartObject(); - if (props) { - var oView3D = props.getView3d(); + if (this.chartProps) { + var props = new Asc.CAscChartProp(); + var oView3D = this.chartProps.getView3d(); if (oView3D) { oView3D.asc_setDepth(field.getNumberValue()); - props.startEdit(); - props.setView3d(oView3D); - props.endEdit(); + this.chartProps.putView3d(oView3D); + props.put_ChartProperties(this.chartProps); + this.api.ChartApply(props); } } } }, on3DHeight: function(field, newValue, oldValue, eOpts){ + if (this._noApply) return; if (this.api){ - var props = this.api.asc_getChartObject(); - if (props) { - var oView3D = props.getView3d(); + if (this.chartProps) { + var props = new Asc.CAscChartProp(); + var oView3D = this.chartProps.getView3d(); if (oView3D) { oView3D.asc_setHeight(field.getNumberValue()); - props.startEdit(); - props.setView3d(oView3D); - props.endEdit(); + this.chartProps.putView3d(oView3D); + props.put_ChartProperties(this.chartProps); + this.api.ChartApply(props); } } } }, onDefRotation: function() { + if (this._noApply) return; if (this.api){ - var props = this.api.asc_getChartObject(); - if (props) { - var oView3D = props.getView3d(); + if (this.chartProps) { + var props = new Asc.CAscChartProp(); + var oView3D = this.chartProps.getView3d(); if (oView3D) { oView3D.asc_setRotX(20); oView3D.asc_setRotY(15); - props.startEdit(); - props.setView3d(oView3D); - props.endEdit(); + this.chartProps.putView3d(oView3D); + props.put_ChartProperties(this.chartProps); + this.api.ChartApply(props); } } }