Merge pull request #1314 from ONLYOFFICE/fix/bugfix

Fix/bugfix
This commit is contained in:
Julia Radzhabova 2021-11-13 15:36:03 +03:00 committed by GitHub
commit e39cc547d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 50 additions and 19 deletions

View file

@ -205,6 +205,8 @@ define([
this._settings[settingsType].props = control_props;
this._settings[settingsType].locked = control_lock;
this._settings[settingsType].hidden = 0;
if (control_props.get_FormPr().get_Fixed())
this._settings[Common.Utils.documentSettingsType.TextArt].hidden = 1;
}
}

View file

@ -1,15 +1,15 @@
<table cols="1">
<tr>
<tr class="no-form">
<td>
<label class="header"><%= scope.strFill %></label>
</td>
</tr>
<tr>
<tr class="no-form">
<td class="padding-small">
<div id="shape-combo-fill-src" style="width: 100%;"></div>
</td>
</tr>
<tr>
<tr class="no-form">
<td>
<div id="shape-panel-color-fill" class="padding-small" style="width: 100%;">
<div id="shape-back-color-btn" style=""></div>
@ -99,7 +99,7 @@
</div>
</td>
</tr>
<tr>
<tr class="no-form">
<td>
<div class="padding-small" id="shape-panel-transparent-fill" style="width: 100%;">
<label class="header" style="display:block;"><%= scope.strTransparency %></label>
@ -112,17 +112,17 @@
</div>
</td>
</tr>
<tr>
<tr class="no-form">
<td class="padding-small">
<div class="separator horizontal"></div>
</td>
</tr>
<tr>
<tr class="no-form">
<td>
<label class="header"><%= scope.strStroke %></label>
</td>
</tr>
<tr>
<tr class="no-form">
<td class="padding-small">
<div style="display:inline-block;width:100px;vertical-align: middle;">
<label class="input-label" style=""><%= scope.strSize %></label>
@ -134,7 +134,7 @@
</div>
</td>
</tr>
<tr>
<tr class="no-form">
<td class="padding-small">
<div style="display:inline-block;width:100px;vertical-align: middle;">
<label class="input-label" style=""><%= scope.strType %></label>
@ -142,7 +142,7 @@
</div>
</td>
</tr>
<tr class="shape-only">
<tr class="shape-only-separator">
<td class="padding-small">
<div class="separator horizontal"></div>
</td>
@ -203,12 +203,12 @@
<div id="shape-btn-change" style="display: inline-block; float:right;"></div>
</td>
</tr>
<tr>
<tr class="no-form">
<td class="padding-small" colspan=2>
<div class="separator horizontal"></div>
</td>
</tr>
<tr>
<tr class="no-form">
<td class="padding-small" colspan=2>
<div id="shape-checkbox-shadow"></div>
</td>

View file

@ -1385,14 +1385,21 @@ define([ 'text!documenteditor/main/app/template/ImageSettingsAdvanced.templat
var shapeprops = props.get_ShapeProperties();
var chartprops = props.get_ChartProperties();
var pluginGuid = props.asc_getPluginGuid();
var control_props = this.api && this.api.asc_IsContentControl() ? this.api.asc_GetContentControlProperties() : null,
fixed_size = false;
if (control_props) {
var spectype = control_props.get_SpecificType();
fixed_size = (spectype==Asc.c_oAscContentControlSpecificType.CheckBox || spectype==Asc.c_oAscContentControlSpecificType.ComboBox ||
spectype==Asc.c_oAscContentControlSpecificType.DropDownList || spectype==Asc.c_oAscContentControlSpecificType.None) &&
control_props.get_FormPr() && control_props.get_FormPr().get_Fixed();
}
this.btnOriginalSize.setVisible(!(shapeprops || chartprops));
this.btnOriginalSize.setDisabled(props.get_ImageUrl()===null || props.get_ImageUrl()===undefined);
this.btnsCategory[5].setVisible(shapeprops!==null && !shapeprops.get_FromChart()); // Shapes
this.btnsCategory[6].setVisible(shapeprops!==null && !shapeprops.get_FromChart()); // Margins
this.btnsCategory[5].setVisible(shapeprops!==null && !shapeprops.get_FromChart() && !fixed_size); // Shapes
this.btnsCategory[6].setVisible(shapeprops!==null && !shapeprops.get_FromChart() && !fixed_size); // Margins
this.btnsCategory[7].setVisible(!fixed_size); // Alt
this.btnsCategory[2].setVisible(!chartprops && (pluginGuid === null || pluginGuid === undefined)); // Rotation
var control_props = this.api && this.api.asc_IsContentControl() ? this.api.asc_GetContentControlProperties() : null;
this.btnsCategory[3].setDisabled(props.get_FromGroup() || !!control_props && (control_props.get_SpecificType()==Asc.c_oAscContentControlSpecificType.Picture)); // Wrapping
if (shapeprops) {

View file

@ -102,7 +102,8 @@ define([
DisabledControls: false,
HideShapeOnlySettings: false,
HideChangeTypeSettings: false,
isFromImage: false
isFromImage: false,
isFixedForm: false
};
this.lockedControls = [];
this._locked = false;
@ -143,6 +144,8 @@ define([
this.TransparencyContainer = $('#shape-panel-transparent-fill');
this.ShapeOnlySettings = $('.shape-only');
this.CanChangeType = $('.change-type');
this.NoFormSettings = $('.no-form');
this.ShapeOnlySeparator = $('.shape-only-separator');
},
setApi: function(api) {
@ -764,6 +767,7 @@ define([
(new DE.Views.ImageSettingsAdvanced(
{
imageProps: elValue,
api: me.api,
sectionProps: me.api.asc_GetSectionProps(),
handler: function(result, value) {
if (result == 'ok') {
@ -790,6 +794,15 @@ define([
if (this._initSettings)
this.createDelayedElements();
var control_props = this.api.asc_IsContentControl() ? this.api.asc_GetContentControlProperties() : null;
if (control_props) {
var spectype = control_props.get_SpecificType();
control_props = (spectype==Asc.c_oAscContentControlSpecificType.CheckBox || spectype==Asc.c_oAscContentControlSpecificType.ComboBox ||
spectype==Asc.c_oAscContentControlSpecificType.DropDownList || spectype==Asc.c_oAscContentControlSpecificType.None) &&
control_props.get_FormPr() && control_props.get_FormPr().get_Fixed();
} else
control_props = false;
if (props && props.get_ShapeProperties())
{
var shapeprops = props.get_ShapeProperties(),
@ -805,7 +818,7 @@ define([
|| shapetype=='bentConnector4' || shapetype=='bentConnector5' || shapetype=='curvedConnector2'
|| shapetype=='curvedConnector3' || shapetype=='curvedConnector4' || shapetype=='curvedConnector5'
|| shapetype=='straightConnector1';
this.hideChangeTypeSettings(hidechangetype);
this.hideChangeTypeSettings(hidechangetype || control_props);
this._state.isFromImage = !!shapeprops.get_FromImage();
if (!hidechangetype && this.btnChangeShape.menu.items.length) {
this.btnChangeShape.menu.items[0].setVisible(shapeprops.get_FromImage());
@ -1189,6 +1202,8 @@ define([
this._noApply = false;
}
this.hideNoFormSettings(control_props);
this.ShapeOnlySeparator.toggleClass('hidden', (control_props || this._state.HideShapeOnlySettings)==true);
},
createDelayedControls: function() {
@ -1959,6 +1974,13 @@ define([
}
},
hideNoFormSettings: function(value) {
if (this._state.isFixedForm !== value) {
this._state.isFixedForm = value;
this.NoFormSettings.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

@ -1488,11 +1488,11 @@ define([
me.mnuCustomScale = new Common.UI.MenuItem({
template: _.template([
'<div class="checkable custom-scale" style="padding: 5px 20px;font-weight: normal;line-height: 1.42857143;font-size: 11px;height: 32px;"',
'<div class="checkable custom-scale" style="padding: 5px 5px 5px 20px;font-weight: normal;line-height: 1.42857143;font-size: 11px;height: 32px;"',
'<% if(!_.isUndefined(options.stopPropagation)) { %>',
'data-stopPropagation="true"',
'<% } %>', '>',
'<label class="title" style="padding-top: 3px;">' + me.textScale + '</label>',
'<label class="title" style="padding-top: 3px;padding-right: 5px;">' + me.textScale + '</label>',
'<button id="custom-scale-up" type="button" style="float:right;" class="btn small btn-toolbar"><i class="icon toolbar__icon btn-zoomup">&nbsp;</i></button>',
'<label id="value-custom-scale" style="float:right;padding: 3px 3px;min-width: 40px; text-align: center;"></label>',
'<button id="custom-scale-down" type="button" style="float:right;" class="btn small btn-toolbar"><i class="icon toolbar__icon btn-zoomdown">&nbsp;</i></button>',