Merge pull request #1712 from ONLYOFFICE/fix/bugfix

Fix/bugfix
This commit is contained in:
Julia Radzhabova 2022-04-20 18:05:06 +03:00 committed by GitHub
commit 639d19413b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 14 deletions

View file

@ -174,7 +174,7 @@ define([
handler : function(result, value) { handler : function(result, value) {
if (result == 'ok') { if (result == 'ok') {
if (me.api) { if (me.api) {
me.addNewEffect(value.activeEffect, value.activeGroupValue, value.activeGroup, replace, undefined, !Common.Utils.InternalSettings.get("pe-animation-no-preview")); me.addNewEffect(value.activeEffect, value.activeGroupValue, value.activeGroup, replace, undefined);
} }
} }
} }
@ -189,7 +189,7 @@ define([
addNewEffect: function (type, group, groupName, replace, parametr, preview) { addNewEffect: function (type, group, groupName, replace, parametr, preview) {
var parameter = this.view.setMenuParameters(type, groupName, parametr); var parameter = this.view.setMenuParameters(type, groupName, parametr);
this.api.asc_AddAnimation(group, type, (parameter != undefined)?parameter:0, replace, preview); this.api.asc_AddAnimation(group, type, (parameter != undefined)?parameter:0, replace, !Common.Utils.InternalSettings.get("pe-animation-no-auto-preview"));
}, },
onDurationChange: function(before,combo, record, e) { onDurationChange: function(before,combo, record, e) {

View file

@ -76,6 +76,12 @@ define([
me.btnPreview.on('click', _.bind(function(btn) { me.btnPreview.on('click', _.bind(function(btn) {
me.fireEvent('animation:preview', [me.btnPreview]); me.fireEvent('animation:preview', [me.btnPreview]);
}, me)); }, me));
me.btnPreview.menu.on('item:click', _.bind(function(menu, item, e) {
if (item.value === 'preview')
me.fireEvent('animation:preview', [me.btnPreview]);
else if (item.value === 'auto')
Common.Utils.InternalSettings.set("pe-animation-no-auto-preview", !item.checked);
}, me));
} }
if(me.cmbTrigger) if(me.cmbTrigger)
@ -239,7 +245,8 @@ define([
this.btnPreview = new Common.UI.Button({ this.btnPreview = new Common.UI.Button({
cls: 'btn-toolbar x-huge icon-top', // x-huge icon-top', cls: 'btn-toolbar x-huge icon-top', // x-huge icon-top',
caption: this.txtPreview, caption: this.txtPreview,
split: false, split: true,
menu: true,
iconCls: 'toolbar__icon animation-preview-start', iconCls: 'toolbar__icon animation-preview-start',
lock: [_set.slideDeleted, _set.noSlides, _set.noAnimationPreview, _set.timingLock], lock: [_set.slideDeleted, _set.noSlides, _set.noAnimationPreview, _set.timingLock],
dataHint: '1', dataHint: '1',
@ -349,7 +356,7 @@ define([
width: 55, width: 55,
value: '', value: '',
defaultUnit: this.txtSec, defaultUnit: this.txtSec,
maxValue: 300, maxValue: 60,
minValue: 0, minValue: 0,
lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.timingLock], lock: [_set.slideDeleted, _set.noSlides, _set.noGraphic, _set.noAnimation, _set.timingLock],
dataHint: '1', dataHint: '1',
@ -513,6 +520,15 @@ define([
me.btnAddAnimation.menu.setInnerMenu([{menu: picker, index: 0}]); me.btnAddAnimation.menu.setInnerMenu([{menu: picker, index: 0}]);
}; };
me.btnAddAnimation.menu.on('show:before', onShowBefore); me.btnAddAnimation.menu.on('show:before', onShowBefore);
me.btnPreview.setMenu( new Common.UI.Menu({
style: "min-width: auto;",
items: [
{caption: me.txtPreview, value: 'preview'},
{caption: me.textAutoPreview, value: 'auto', checkable: true, checked: !Common.Utils.InternalSettings.get("pe-animation-no-auto-preview")}
]
}));
setEvents.call(me); setEvents.call(me);
}); });
}, },
@ -625,7 +641,8 @@ define([
str3: '3 s (Slow)', str3: '3 s (Slow)',
str2: '2 s (Medium)', str2: '2 s (Medium)',
str1: '1 s (Fast)', str1: '1 s (Fast)',
str0_5: '0.5 s (Very Fast)' str0_5: '0.5 s (Very Fast)',
textAutoPreview: 'AutoPreview'
} }
}()), PE.Views.Animation || {})); }()), PE.Views.Animation || {}));

View file

@ -44,7 +44,7 @@ define([
PE.Views.AnimationDialog = Common.UI.Window.extend(_.extend({ PE.Views.AnimationDialog = Common.UI.Window.extend(_.extend({
options: { options: {
width: 350, width: 350,
height: 426, height: 396,
header: true, header: true,
cls: 'animation-dlg', cls: 'animation-dlg',
buttons: ['ok', 'cancel'] buttons: ['ok', 'cancel']
@ -57,8 +57,8 @@ define([
'<div class="box" style="width: 318px; margin: 0 auto">', '<div class="box" style="width: 318px; margin: 0 auto">',
'<div class = "input-row" id = "animation-group"></div>', '<div class = "input-row" id = "animation-group"></div>',
'<div class = "input-row" id = "animation-level" ></div>', '<div class = "input-row" id = "animation-level" ></div>',
'<div class = "input-row" id = "animation-list" style = "margin-top: 16px; height: 216px;"></div>', '<div class = "input-row" id = "animation-list" style = "margin: 16px 0; height: 216px;"></div>',
'<div class = "input-row" id = "animation-setpreview" style = "margin: 16px 0;"></div>', // '<div class = "input-row" id = "animation-setpreview" style = "margin: 16px 0;"></div>',
'</div>' '</div>'
].join(''); ].join('');
this.allEffects = Common.define.effectData.getEffectFullData(); this.allEffects = Common.define.effectData.getEffectFullData();
@ -125,11 +125,11 @@ define([
}); });
this.lstEffectList.on('item:select', _.bind(this.onEffectListItem,this)); this.lstEffectList.on('item:select', _.bind(this.onEffectListItem,this));
this.chPreview = new Common.UI.CheckBox({ // this.chPreview = new Common.UI.CheckBox({
el : $('#animation-setpreview'), // el : $('#animation-setpreview'),
labelText : this.textPreviewEffect, // labelText : this.textPreviewEffect,
value: !Common.Utils.InternalSettings.get("pe-animation-no-preview") // value: !Common.Utils.InternalSettings.get("pe-animation-no-preview")
}).on('change', _.bind(this.onPreviewChange, this)); // }).on('change', _.bind(this.onPreviewChange, this));
this.cmbGroup.setValue(this._state.activeGroupValue); this.cmbGroup.setValue(this._state.activeGroupValue);
this.fillLevel(); this.fillLevel();
@ -138,7 +138,7 @@ define([
}, },
getFocusedComponents: function() { getFocusedComponents: function() {
return [ this.cmbGroup, this.cmbLevel, this.lstEffectList, this.chPreview]; return [ this.cmbGroup, this.cmbLevel, this.lstEffectList/*, this.chPreview*/];
}, },
getDefaultFocusableComponent: function () { getDefaultFocusableComponent: function () {

View file

@ -1321,6 +1321,7 @@
"PE.Views.Animation.txtParameters": "Parameters", "PE.Views.Animation.txtParameters": "Parameters",
"PE.Views.Animation.txtPreview": "Preview", "PE.Views.Animation.txtPreview": "Preview",
"PE.Views.Animation.txtSec": "s", "PE.Views.Animation.txtSec": "s",
"PE.Views.Animation.textAutoPreview": "AutoPreview",
"PE.Views.AnimationDialog.textPreviewEffect": "Preview Effect", "PE.Views.AnimationDialog.textPreviewEffect": "Preview Effect",
"PE.Views.AnimationDialog.textTitle": "More Effects", "PE.Views.AnimationDialog.textTitle": "More Effects",
"PE.Views.ChartSettings.textAdvanced": "Show advanced settings", "PE.Views.ChartSettings.textAdvanced": "Show advanced settings",

View file

@ -1320,6 +1320,7 @@
"PE.Views.Animation.txtAnimationPane": "Область анимации", "PE.Views.Animation.txtAnimationPane": "Область анимации",
"PE.Views.Animation.txtParameters": "Параметры", "PE.Views.Animation.txtParameters": "Параметры",
"PE.Views.Animation.txtPreview": "Просмотр", "PE.Views.Animation.txtPreview": "Просмотр",
"PE.Views.Animation.textAutoPreview": "Автопросмотр",
"PE.Views.Animation.txtSec": "сек", "PE.Views.Animation.txtSec": "сек",
"PE.Views.AnimationDialog.textPreviewEffect": "Просмотр эффекта", "PE.Views.AnimationDialog.textPreviewEffect": "Просмотр эффекта",
"PE.Views.AnimationDialog.textTitle": "Другие эффекты", "PE.Views.AnimationDialog.textTitle": "Другие эффекты",