diff --git a/apps/documenteditor/main/app/view/ShapeSettings.js b/apps/documenteditor/main/app/view/ShapeSettings.js index 719f62cef8..4a0c4d6c40 100644 --- a/apps/documenteditor/main/app/view/ShapeSettings.js +++ b/apps/documenteditor/main/app/view/ShapeSettings.js @@ -77,8 +77,7 @@ define([ this.imgprops = null; this._sendUndoPoint = true; this._sliderChanged = false; - this._sendLineUndoPoint = true; - this._sliderLineChanged = false; + this._sliderChangedLine = false; this._texturearray = null; this.txtPt = Common.Utils.Metric.getMetricName(Common.Utils.Metric.c_MetricUnits.pt); @@ -146,7 +145,6 @@ define([ this.FillPatternContainer = $('#shape-panel-pattern-fill'); this.FillGradientContainer = $('#shape-panel-gradient-fill'); this.TransparencyContainer = $('#shape-panel-transparent-fill'); - this.LineTransparencyContainer = $('#shape-line-panel-transparent'); this.ShapeOnlySettings = $('.shape-only'); this.CanChangeType = $('.change-type'); this.RotationSettings = $('.shape-rotation'); @@ -688,10 +686,10 @@ define([ onNumLineTransparencyChange: function(field, newValue, oldValue, eOpts){ this.sldrLineTransparency.setValue(field.getNumberValue(), true); - if (this.api) { + this._state.LineTransparency = field.getNumberValue() * 2.55; + if (this.api && this.BorderSize>0 && !this._noApply) { var props = new Asc.asc_CShapeProperty(); var stroke = new Asc.asc_CStroke(); - this._state.LineTransparency = field.getNumberValue() * 2.55; stroke.put_transparent(this._state.LineTransparency); props.put_stroke(stroke); this.imgprops.put_ShapeProperties(props); @@ -700,36 +698,27 @@ define([ }, onLineTransparencyChange: function(field, newValue, oldValue){ - this._sliderLineChanged = newValue; + this._sliderChangedLine = newValue; this.numLineTransparency.setValue(newValue, true); - if (this._sendLineUndoPoint) { - this.api.setStartPointHistory(); - this._sendLineUndoPoint = false; - this.updatesliderline = setInterval(_.bind(this._transparencyLineApplyFunc, this), 100); - } + this.updatesliderline = setInterval(_.bind(this._transparencyLineApplyFunc, this), 100); }, onLineTransparencyChangeComplete: function(field, newValue, oldValue){ clearInterval(this.updatesliderline); - this._sliderlineChanged = newValue; - if (!this._sendLineUndoPoint) { // start point was added - this.api.setEndPointHistory(); - this._transparencyLineApplyFunc(); - } - this._sendLineUndoPoint = true; + this._sliderChangedLine = newValue; + this._transparencyLineApplyFunc(); }, _transparencyLineApplyFunc: function() { - if (this._sliderLineChanged!==undefined) { + if (this._sliderChangedLine!==undefined) { + this._state.LineTransparency = this._sliderChangedLine * 2.55; var props = new Asc.asc_CShapeProperty(); var stroke = new Asc.asc_CStroke(); - this._state.LineTransparency = this._sliderLineChanged * 2.55; stroke.put_transparent(this._state.LineTransparency); props.put_stroke(stroke); - this.imgprops.put_ShapeProperties(props); this.api.ImgApply(this.imgprops); - this._sliderLineChanged = undefined; + this._sliderChangedLine = undefined; } }, @@ -1653,8 +1642,8 @@ define([ this.sldrLineTransparency.on('changecomplete', _.bind(this.onLineTransparencyChangeComplete, this));/**/ this.lockedControls.push(this.sldrLineTransparency); - this.lockedControls.push( $(this.el).find('#shape-line-lbl-transparency-start')); - this.lockedControls.push( $(this.el).find('#shape-line-lbl-transparency-end')); + this.lblLineTransparencyStart = $(this.el).find('#shape-line-lbl-transparency-start'); + this.lblLineTransparencyEnd = $(this.el).find('#shape-line-lbl-transparency-end'); this.numLineTransparency = new Common.UI.MetricSpinner({ el: $('#shape-line-spin-transparency'), @@ -2078,6 +2067,8 @@ define([ item.setDisabled(disable); }); this.linkAdvanced.toggleClass('disabled', disable); + this.lblLineTransparencyStart.toggleClass('disabled', disable); + this.lblLineTransparencyEnd.toggleClass('disabled', disable); } this.btnFlipV.setDisabled(disable || this._state.isFromSmartArtInternal); this.btnFlipH.setDisabled(disable || this._state.isFromSmartArtInternal); diff --git a/apps/documenteditor/main/app/view/TextArtSettings.js b/apps/documenteditor/main/app/view/TextArtSettings.js index 15364884bd..ce85e31505 100644 --- a/apps/documenteditor/main/app/view/TextArtSettings.js +++ b/apps/documenteditor/main/app/view/TextArtSettings.js @@ -552,48 +552,39 @@ define([ onNumLineTransparencyChange: function(field, newValue, oldValue, eOpts){ this.sldrLineTransparency.setValue(field.getNumberValue(), true); - if (this.api) { - this._state.LineTransparency = field.getNumberValue() * 2.55; + this._state.LineTransparency = field.getNumberValue() * 2.55; + if (this.api && this.BorderSize>0 && !this._noApply) { var props = new Asc.asc_TextArtProperties(); var stroke = new Asc.asc_CStroke(); stroke.put_transparent(this._state.LineTransparency); - props.asc_putLine(stroke); + props.put_stroke(stroke); this.shapeprops.put_TextArtProperties(props); this.api.ImgApply(this.imgprops); } }, onLineTransparencyChange: function(field, newValue, oldValue){ - this._sliderLineChanged = newValue; + this._sliderChangedLine = newValue; this.numLineTransparency.setValue(newValue, true); - - if (this._sendLineUndoPoint) { - this.api.setStartPointHistory(); - this._sendLineUndoPoint = false; - this.updatesliderline = setInterval(_.bind(this._transparencyLineApplyFunc, this), 100); - } + this.updatesliderline = setInterval(_.bind(this._transparencyLineApplyFunc, this), 100); }, onLineTransparencyChangeComplete: function(field, newValue, oldValue){ clearInterval(this.updatesliderline); - this._sliderLineChanged = newValue; - if (!this._sendLineUndoPoint) { // start point was added - this.api.setEndPointHistory(); - this._transparencyLineApplyFunc(); - } - this._sendLineUndoPoint = true; + this._sliderChangedLine = newValue; + this._transparencyLineApplyFunc(); }, _transparencyLineApplyFunc: function() { - if (this._sliderLineChanged!==undefined) { + if (this._sliderChangedLine!==undefined) { + this._state.LineTransparency = this._sliderChangedLine * 2.55; var props = new Asc.asc_TextArtProperties(); var stroke = new Asc.asc_CStroke(); - this._state.LineTransparency = this._sliderLineChanged * 2.55; stroke.put_transparent(this._state.LineTransparency); props.asc_putLine(stroke); this.shapeprops.put_TextArtProperties(props); this.api.ImgApply(this.imgprops); - this._sliderLineChanged = undefined; + this._sliderChangedLine = undefined; } }, @@ -1209,8 +1200,8 @@ define([ this.sldrLineTransparency.on('changecomplete', _.bind(this.onLineTransparencyChangeComplete, this)); this.lockedControls.push(this.sldrLineTransparency); - this.lockedControls.push($(this.el).find('#textart-lbl-transparency-start')); - this.lockedControls.push($(this.el).find('#textart-lbl-transparency-end')); + this.lblLineTransparencyStart = $(this.el).find('#textart-line-lbl-transparency-start'); + this.lblLineTransparencyEnd = $(this.el).find('#textart-line-lbl-transparency-end'); this.cmbTransform = new Common.UI.ComboDataView({ itemWidth: 50, @@ -1395,6 +1386,8 @@ define([ item.setDisabled(disable); }); this.numGradientAngle.setDisabled(disable || this.GradFillType !== Asc.c_oAscFillGradType.GRAD_LINEAR); + this.lblLineTransparencyStart.toggleClass('disabled', disable); + this.lblLineTransparencyEnd.toggleClass('disabled', disable); } }, diff --git a/apps/presentationeditor/main/app/template/ShapeSettings.template b/apps/presentationeditor/main/app/template/ShapeSettings.template index 70e1eac369..7a16de54df 100644 --- a/apps/presentationeditor/main/app/template/ShapeSettings.template +++ b/apps/presentationeditor/main/app/template/ShapeSettings.template @@ -134,6 +134,14 @@ + + +
+ +
+
+ +
@@ -147,14 +155,6 @@
- - -
- -
-
- -
diff --git a/apps/presentationeditor/main/app/view/ShapeSettings.js b/apps/presentationeditor/main/app/view/ShapeSettings.js index 4be9e35a0a..9cb5734b84 100644 --- a/apps/presentationeditor/main/app/view/ShapeSettings.js +++ b/apps/presentationeditor/main/app/view/ShapeSettings.js @@ -687,46 +687,40 @@ define([ onNumLineTransparencyChange: function(field, newValue, oldValue, eOpts){ this.sldrLineTransparency.setValue(field.getNumberValue(), true); - if (this.api) { + this._state.LineTransparency = field.getNumberValue() * 2.55; + if (this.api && this.BorderSize>0 && !this._noApply) { var props = new Asc.asc_CShapeProperty(); var stroke = new Asc.asc_CStroke(); - this._state.LineTransparency = field.getNumberValue() * 2.55; stroke.put_transparent(this._state.LineTransparency); props.put_stroke(stroke); this.api.ShapeApply(props); } + this.fireEvent('editcomplete', this); }, onLineTransparencyChange: function(field, newValue, oldValue){ - this._sliderLineChanged = newValue; + this._sliderChangedLine = newValue; this.numLineTransparency.setValue(newValue, true); - if (this._sendLineUndoPoint) { - this.api.setStartPointHistory(); - this._sendLineUndoPoint = false; - this.updatesliderline = setInterval(_.bind(this._transparencyLineApplyFunc, this), 100); - } + this.updatesliderline = setInterval(_.bind(this._transparencyLineApplyFunc, this), 100); }, onLineTransparencyChangeComplete: function(field, newValue, oldValue){ clearInterval(this.updatesliderline); - this._sliderlineChanged = newValue; - if (!this._sendLineUndoPoint) { // start point was added - this.api.setEndPointHistory(); - this._transparencyLineApplyFunc(); - } - this._sendLineUndoPoint = true; + this._sliderChangedLine = newValue; + this._transparencyLineApplyFunc(); }, _transparencyLineApplyFunc: function() { - if (this._sliderLineChanged!==undefined) { + if (this._sliderChangedLine!==undefined) { + this._state.LineTransparency = this._sliderChangedLine * 2.55; var props = new Asc.asc_CShapeProperty(); var stroke = new Asc.asc_CStroke(); - this._state.LineTransparency = this._sliderLineChanged * 2.55; stroke.put_transparent(this._state.LineTransparency); props.put_stroke(stroke); this.api.ShapeApply(props); - this._sliderLineChanged = undefined; + this._sliderChangedLine = undefined; } + this.fireEvent('editcomplete', this); }, setImageUrl: function(url, token) { @@ -1570,8 +1564,8 @@ define([ this.sldrLineTransparency.on('changecomplete', _.bind(this.onLineTransparencyChangeComplete, this)); this.lockedControls.push(this.sldrLineTransparency); - this.lockedControls.push( $(this.el).find('#shape-line-lbl-transparency-start')); - this.lockedControls.push( $(this.el).find('#shape-line-lbl-transparency-end')); + this.lblLineTransparencyStart = $(this.el).find('#shape-line-lbl-transparency-start'); + this.lblLineTransparencyEnd = $(this.el).find('#shape-line-lbl-transparency-end'); this.btnChangeShape = new Common.UI.Button({ parentEl: $('#shape-btn-change'), @@ -1937,6 +1931,8 @@ define([ item.setDisabled(disable); }); this.linkAdvanced.toggleClass('disabled', disable); + this.lblLineTransparencyStart.toggleClass('disabled', disable); + this.lblLineTransparencyEnd.toggleClass('disabled', disable); } this.btnFlipV.setDisabled(disable || this._state.isFromSmartArtInternal); this.btnFlipH.setDisabled(disable || this._state.isFromSmartArtInternal); diff --git a/apps/presentationeditor/main/app/view/TextArtSettings.js b/apps/presentationeditor/main/app/view/TextArtSettings.js index 3dcb1ea205..234deb1510 100644 --- a/apps/presentationeditor/main/app/view/TextArtSettings.js +++ b/apps/presentationeditor/main/app/view/TextArtSettings.js @@ -677,8 +677,8 @@ define([ onNumLineTransparencyChange: function(field, newValue, oldValue, eOpts){ this.sldrLineTransparency.setValue(field.getNumberValue(), true); - if (this.api) { - this._state.LineTransparency = field.getNumberValue() * 2.55; + this._state.LineTransparency = field.getNumberValue() * 2.55; + if (this.api && this.BorderSize>0 && !this._noApply) { var props = new Asc.asc_TextArtProperties(); var stroke = new Asc.asc_CStroke(); stroke.put_transparent(this._state.LineTransparency); @@ -686,40 +686,33 @@ define([ this.shapeprops.put_TextArtProperties(props); this.api.ShapeApply(this.shapeprops); } + this.fireEvent('editcomplete', this); }, onLineTransparencyChange: function(field, newValue, oldValue){ this._sliderChangedLine = newValue; this.numLineTransparency.setValue(newValue, true); - - if (this._sendLineUndoPoint) { - this.api.setStartPointHistory(); - this._sendLineUndoPoint = false; - this.updatesliderline = setInterval(_.bind(this._transparencyLineApplyFunc, this), 100); - } + this.updatesliderline = setInterval(_.bind(this._transparencyLineApplyFunc, this), 100); }, onLineTransparencyChangeComplete: function(field, newValue, oldValue){ clearInterval(this.updatesliderline); this._sliderChangedLine = newValue; - if (!this._sendLineUndoPoint) { // start point was added - this.api.setEndPointHistory(); - this._transparencyLineApplyFunc(); - } - this._sendLineUndoPoint = true; + this._transparencyLineApplyFunc(); }, _transparencyLineApplyFunc: function() { if (this._sliderChangedLine!==undefined) { + this._state.LineTransparency = this._sliderChangedLine * 2.55; var props = new Asc.asc_TextArtProperties(); var stroke = new Asc.asc_CStroke(); - this._state.LineTransparency = this._sliderChangedLine * 2.55; stroke.put_transparent(this._state.LineTransparency); props.asc_putLine(stroke); this.shapeprops.put_TextArtProperties(props); this.api.ShapeApply(this.shapeprops); this._sliderChangedLine = undefined; } + this.fireEvent('editcomplete', this); }, insertFromUrl: function() { @@ -1529,10 +1522,10 @@ define([ }); this.sldrLineTransparency.on('change', _.bind(this.onLineTransparencyChange, this)); this.sldrLineTransparency.on('changecomplete', _.bind(this.onLineTransparencyChangeComplete, this)); - this.lockedControls.push(this.sldrTransparency); + this.lockedControls.push(this.sldrLineTransparency); - this.lockedControls.push($(this.el).find('#textart-lbl-transparency-start')); - this.lockedControls.push( $(this.el).find('#textart-lbl-transparency-end')); + this.lblLineTransparencyStart = $(this.el).find('#textart-line-lbl-transparency-start'); + this.lblLineTransparencyEnd = $(this.el).find('#textart-line-lbl-transparency-end'); this.cmbTransform = new Common.UI.ComboDataView({ itemWidth: 50, @@ -1849,6 +1842,8 @@ define([ item.setDisabled(disable); }); this.numGradientAngle.setDisabled(disable || this.GradFillType !== Asc.c_oAscFillGradType.GRAD_LINEAR); + this.lblLineTransparencyStart.toggleClass('disabled', disable); + this.lblLineTransparencyEnd.toggleClass('disabled', disable); } }, diff --git a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js index eb41682968..2420276a77 100644 --- a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js @@ -677,9 +677,9 @@ define([ }, onNumLineTransparencyChange: function(field, newValue, oldValue, eOpts){ - this.sldrTransparency.setValue(field.getNumberValue(), true); - if (this.api) { - this._state.LineTransparency = field.getNumberValue() * 2.55; + this.sldrLineTransparency.setValue(field.getNumberValue(), true); + this._state.LineTransparency = field.getNumberValue() * 2.55; + if (this.api && !this._noApply) { var props = new Asc.asc_CShapeProperty(); var stroke = new Asc.asc_CStroke(); stroke.asc_putTransparent(this._state.LineTransparency); @@ -692,29 +692,20 @@ define([ onLineTransparencyChange: function(field, newValue, oldValue){ this._sliderChangedLine = newValue; this.numLineTransparency.setValue(newValue, true); - - if (this._sendLineUndoPoint) { - this.api.setStartPointHistory(); - this._sendLineUndoPoint = false; - this.updatesliderline = setInterval(_.bind(this._transparencyLineApplyFunc, this), 100); - } + this.updatesliderline = setInterval(_.bind(this._transparencyLineApplyFunc, this), 100); }, onLineTransparencyChangeComplete: function(field, newValue, oldValue){ clearInterval(this.updatesliderline); this._sliderChangedLine = newValue; - if (!this._sendLineUndoPoint) { // start point was added - this.api.setEndPointHistory(); - this._transparencyLineApplyFunc(); - } - this._sendLineUndoPoint = true; + this._transparencyLineApplyFunc(); }, _transparencyLineApplyFunc: function() { if (this._sliderChangedLine!==undefined) { + this._state.LineTransparency = this._sliderChangedLine * 2.55; var props = new Asc.asc_CShapeProperty(); var stroke = new Asc.asc_CStroke(); - this._state.LineTransparency = this._sliderChangedLine * 2.55; stroke.asc_putTransparent(this._state.LineTransparency); props.asc_putStroke(stroke); this.imgprops.asc_putShapeProperties(props); @@ -1588,8 +1579,8 @@ define([ this.sldrLineTransparency.on('changecomplete', _.bind(this.onLineTransparencyChangeComplete, this)); this.lockedControls.push(this.sldrLineTransparency); - this.lockedControls.push($(this.el).find('#shape-lbl-transparency-start')); - this.lockedControls.push($(this.el).find('#shape-lbl-transparency-end')); + this.lblLineTransparencyStart = $(this.el).find('#shape-line-lbl-transparency-start'); + this.lblLineTransparencyEnd = $(this.el).find('#shape-line-lbl-transparency-end'); this.btnChangeShape = new Common.UI.Button({ parentEl: $('#shape-btn-change'), @@ -1958,6 +1949,8 @@ define([ item.setDisabled(disable); }); this.linkAdvanced.toggleClass('disabled', disable); + this.lblLineTransparencyStart.toggleClass('disabled', disable); + this.lblLineTransparencyEnd.toggleClass('disabled', disable); } this.btnFlipV.setDisabled(disable || this._state.isFromSmartArtInternal); this.btnFlipH.setDisabled(disable || this._state.isFromSmartArtInternal); diff --git a/apps/spreadsheeteditor/main/app/view/TextArtSettings.js b/apps/spreadsheeteditor/main/app/view/TextArtSettings.js index 09982d39cc..92684110a9 100644 --- a/apps/spreadsheeteditor/main/app/view/TextArtSettings.js +++ b/apps/spreadsheeteditor/main/app/view/TextArtSettings.js @@ -671,8 +671,8 @@ define([ onNumLineTransparencyChange: function(field, newValue, oldValue, eOpts){ this.sldrLineTransparency.setValue(field.getNumberValue(), true); - if (this.api) { - this._state.LineTransparency = field.getNumberValue() * 2.55; + this._state.LineTransparency = field.getNumberValue() * 2.55; + if (this.api && this.BorderSize>0 && !this._noApply) { var props = new Asc.asc_TextArtProperties(); var stroke = new Asc.asc_CStroke(); stroke.asc_putTransparent(this._state.LineTransparency); @@ -685,29 +685,20 @@ define([ onLineTransparencyChange: function(field, newValue, oldValue){ this._sliderChangedLine = newValue; this.numLineTransparency.setValue(newValue, true); - - if (this._sendLineUndoPoint) { - this.api.setStartPointHistory(); - this._sendLineUndoPoint = false; - this.updatesliderline = setInterval(_.bind(this._transparencyLineApplyFunc, this), 100); - } + this.updatesliderline = setInterval(_.bind(this._transparencyLineApplyFunc, this), 100); }, onLineTransparencyChangeComplete: function(field, newValue, oldValue){ clearInterval(this.updatesliderline); this._sliderChangedLine = newValue; - if (!this._sendLineUndoPoint) { // start point was added - this.api.setEndPointHistory(); - this._transparencyLineApplyFunc(); - } - this._sendUndoPoint = true; + this._transparencyLineApplyFunc(); }, _transparencyLineApplyFunc: function() { if (this._sliderChangedLine!==undefined) { + this._state.LineTransparency = this._sliderChangedLine * 2.55; var props = new Asc.asc_TextArtProperties(); var stroke = new Asc.asc_CStroke(); - this._state.LineTransparency = this._sliderChangedLine * 2.55; stroke.asc_putTransparent(this._state.LineTransparency); props.asc_putLine(stroke); this.shapeprops.put_TextArtProperties(props); @@ -1487,7 +1478,7 @@ define([ this.lockedControls.push(this.cmbBorderSize); this.cmbBorderType = new Common.UI.ComboBorderType({ - el: $('#textart-line-combo-border-type'), + el: $('#textart-combo-border-type'), style: "width: 93px;", menuStyle: 'min-width: 93px;', dataHint: '1', @@ -1526,8 +1517,8 @@ define([ this.sldrLineTransparency.on('changecomplete', _.bind(this.onLineTransparencyChangeComplete, this)); this.lockedControls.push(this.sldrLineTransparency); - this.lockedControls.push($(this.el).find('#textart-line-lbl-transparency-start')); - this.lockedControls.push($(this.el).find('#textart-line-lbl-transparency-end')); + this.lblLineTransparencyStart = $(this.el).find('#textart-line-lbl-transparency-start'); + this.lblLineTransparencyEnd = $(this.el).find('#textart-line-lbl-transparency-end'); this.cmbTransform = new Common.UI.ComboDataView({ itemWidth: 50, @@ -1844,6 +1835,8 @@ define([ item.setDisabled(disable); }); this.numGradientAngle.setDisabled(disable || this.GradFillType !== Asc.c_oAscFillGradType.GRAD_LINEAR); + this.lblLineTransparencyStart.toggleClass('disabled', disable); + this.lblLineTransparencyEnd.toggleClass('disabled', disable); } },