[DE] Hide controls for smart arts in right panel

This commit is contained in:
JuliaSvinareva 2021-10-28 21:21:49 +03:00
parent d81ed7c041
commit d6920073de
4 changed files with 39 additions and 13 deletions

View file

@ -142,17 +142,17 @@
</div>
</td>
</tr>
<tr class="shape-only">
<tr class="shape-only shape-rotation">
<td class="padding-small">
<div class="separator horizontal"></div>
</td>
</tr>
<tr class="shape-only">
<tr class="shape-only shape-rotation">
<td class="padding-small">
<label class="header"><%= scope.textRotation %></label>
</td>
</tr>
<tr class="shape-only">
<tr class="shape-only shape-rotation">
<td>
<table cols="2" style="width: 100%;">
<tr>

View file

@ -120,17 +120,17 @@
</div>
</td>
</tr>
<tr>
<tr class="textart-transform">
<td class="padding-small">
<div class="separator horizontal"></div>
</td>
</tr>
<tr>
<tr class="textart-transform">
<td>
<label class="header"><%= scope.textTransform %></label>
</td>
</tr>
<tr>
<tr class="textart-transform">
<td class="padding-small">
<div class="" id="textart-combo-transform" style="width: 100%; height: 42px;"></div>
</td>

View file

@ -102,7 +102,9 @@ define([
DisabledControls: false,
HideShapeOnlySettings: false,
HideChangeTypeSettings: false,
isFromImage: false
HideRotationSettings: false,
isFromImage: false,
isFromSmartArtInternal: false
};
this.lockedControls = [];
this._locked = false;
@ -144,6 +146,7 @@ define([
this.TransparencyContainer = $('#shape-panel-transparent-fill');
this.ShapeOnlySettings = $('.shape-only');
this.CanChangeType = $('.change-type');
this.RotationSettings = $('.shape-rotation');
},
setApi: function(api) {
@ -804,16 +807,18 @@ define([
this.disableControls(this._locked, !shapeprops.get_CanFill());
this.hideShapeOnlySettings(shapeprops.get_FromChart() || shapeprops.get_FromImage());
this.hideRotationSettings(shapeprops.get_FromSmartArt());
var hidechangetype = shapeprops.get_FromChart() || shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3'
var hidechangetype = shapeprops.get_FromChart() || shapeprops.get_FromSmartArt() || shapetype=='line' || shapetype=='bentConnector2' || shapetype=='bentConnector3'
|| shapetype=='bentConnector4' || shapetype=='bentConnector5' || shapetype=='curvedConnector2'
|| shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5'
|| shapetype=='straightConnector1';
this.hideChangeTypeSettings(hidechangetype);
this._state.isFromImage = !!shapeprops.get_FromImage();
this._state.isFromSmartArtInternal = !!shapeprops.get_FromSmartArtInternal();
if (!hidechangetype && this.btnChangeShape.menu.items.length) {
this.btnChangeShape.menu.items[0].setVisible(shapeprops.get_FromImage());
this.btnChangeShape.menu.items[1].setVisible(!shapeprops.get_FromImage());
this.btnChangeShape.menu.items[0].setVisible(shapeprops.get_FromImage() || shapeprops.get_FromSmartArtInternal());
this.btnChangeShape.menu.items[1].setVisible(!shapeprops.get_FromImage() && !shapeprops.get_FromSmartArtInternal());
}
var value = props.get_WrappingStyle();
@ -1845,8 +1850,8 @@ define([
me.btnChangeShape.menu.hide();
});
}
me.btnChangeShape.menu.items[0].setVisible(me._state.isFromImage);
me.btnChangeShape.menu.items[1].setVisible(!me._state.isFromImage);
me.btnChangeShape.menu.items[0].setVisible(me._state.isFromImage || me._state.isFromSmartArtInternal);
me.btnChangeShape.menu.items[1].setVisible(!me._state.isFromImage && !me._state.isFromSmartArtInternal);
},
UpdateThemeColors: function() {
@ -1976,6 +1981,13 @@ define([
}
},
hideRotationSettings: function(value) {
if (this._state.HideRotationSettings !== value) {
this._state.HideRotationSettings = value;
this.RotationSettings.toggleClass('hidden', value==true);
}
},
onPositionChange: function(btn) {
var pos = btn.getNumberValue(),
minValue = (this.GradColor.currentIdx-1<0) ? 0 : this.GradColor.values[this.GradColor.currentIdx-1],

View file

@ -90,7 +90,9 @@ define([
GradFillType: Asc.c_oAscFillGradType.GRAD_LINEAR,
FormId: null,
DisabledControls: false,
applicationPixelRatio: Common.Utils.applicationPixelRatio()
applicationPixelRatio: Common.Utils.applicationPixelRatio(),
isFromSmartArtInternal: false,
HideTransformSettings: false
};
this.lockedControls = [];
this._locked = false;
@ -123,6 +125,8 @@ define([
this.FillGradientContainer = $('#textart-panel-gradient-fill');
this.TransparencyContainer = $('#textart-panel-transparent-fill');
this.TransformSettings = $('.textart-transform');
$(window).on('resize', _.bind(this.onWindowResize, this));
},
@ -547,6 +551,9 @@ define([
if (this._initSettings)
this.createDelayedElements();
this._state.isFromSmartArtInternal = props.get_ShapeProperties() && props.get_ShapeProperties().get_FromSmartArtInternal();
this.hideTransformSettings(this._state.isFromSmartArtInternal);
if (props && props.get_ShapeProperties() && props.get_ShapeProperties().get_TextArtProperties())
{
var shapeprops = props.get_ShapeProperties().get_TextArtProperties();
@ -1344,6 +1351,13 @@ define([
this._state.applicationPixelRatio = Common.Utils.applicationPixelRatio();
},
hideTransformSettings: function(value) {
if (this._state.HideTransformSettings !== value) {
this._state.HideTransformSettings = value;
this.TransformSettings.toggleClass('hidden', value === true);
}
},
txtNoBorders : 'No Line',
strStroke : 'Stroke',
strColor : 'Color',