Skip to content

Commit

Permalink
Merge pull request #2949 from ONLYOFFICE/fix/AnimPane
Browse files Browse the repository at this point in the history
Fix/anim pane
  • Loading branch information
SergeyLuzyanin authored Apr 19, 2024
2 parents 03ad9d8 + f44e31f commit fb76d37
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
16 changes: 16 additions & 0 deletions apps/presentationeditor/main/app/controller/Animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,22 @@ define([

updateThemeColors: function (){
this.view.updateColors();
},

getAnimationPanelTip: function (effect) {
var result;
if (effect) {
var nodeType = effect[0] === AscFormat.NODE_TYPE_CLICKEFFECT ? this.view.textStartOnClick :
(effect[0] === AscFormat.NODE_TYPE_WITHEFFECT ? this.view.textStartWithPrevious :
(effect[0] === AscFormat.NODE_TYPE_AFTEREFFECT ? this.view.textStartAfterPrevious : ''));
var presetClass = _.findWhere(Common.define.effectData.getEffectGroupData(), {value: effect[1]});
presetClass = presetClass ? presetClass.caption : '';
var preset = _.findWhere(Common.define.effectData.getEffectData(), {value: effect[2]});
preset = preset ? preset.displayValue : '';
var name = effect[3] || '';
result = nodeType + '\n' + presetClass + '\n' + preset + ' : ' + name;
}
return result;
}

}, PE.Controllers.Animation || {}));
Expand Down
22 changes: 15 additions & 7 deletions apps/presentationeditor/main/app/controller/DocumentHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,12 +493,16 @@ define([
}

if (event.get_Type() == Asc.c_oAscContextMenuTypes.AnimEffect) {
showPoint[0] += event.get_ButtonWidth() + 2;
showPoint[1] += event.get_ButtonHeight() + 2;
menu.menuAlign = 'tr-br';
if (me.documentHolder.cmpEl.offset().top + showPoint[1] + menu.menuRoot.outerHeight() > Common.Utils.innerHeight() - 10) {
showPoint[1] -= event.get_ButtonHeight() + 4;
menu.menuAlign = 'br-tr';
if (event.get_ButtonWidth()) {
showPoint[0] += event.get_ButtonWidth() + 2;
showPoint[1] += event.get_ButtonHeight() + 2;
menu.menuAlign = 'tr-br';
if (me.documentHolder.cmpEl.offset().top + showPoint[1] + menu.menuRoot.outerHeight() > Common.Utils.innerHeight() - 10) {
showPoint[1] -= event.get_ButtonHeight() + 4;
menu.menuAlign = 'br-tr';
}
} else {
menu.menuAlign = 'tl-tr';
}
}

Expand Down Expand Up @@ -948,7 +952,11 @@ define([
break;
}
} else if (type===Asc.c_oAscMouseMoveDataTypes.EffectInfo) {
ToolTip = moveData.get_Info();
var tip = moveData.get_EffectText();
if (!tip) {
tip = me.getApplication().getController('Animation').getAnimationPanelTip(moveData.get_EffectDescription()) || '';
}
ToolTip = tip;
}
var recalc = false;
screenTip.isHidden = false;
Expand Down
1 change: 0 additions & 1 deletion apps/presentationeditor/main/app/view/DocumentHolder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2474,7 +2474,6 @@ define([
me.animEffectMenu = new Common.UI.Menu({
restoreHeightAndTop: true,
scrollToCheckedItem: false,
menuAlign: 'tr-br',
style: 'min-width: auto;',
initMenu: function(value){
me.menuAnimStartOnClick.setChecked(value.effect === AscFormat.NODE_TYPE_CLICKEFFECT, true);
Expand Down

0 comments on commit fb76d37

Please sign in to comment.