From 81be6f12f8e383cc0f8258f061fd083f31c73bbc Mon Sep 17 00:00:00 2001 From: "Julia.Svinareva" Date: Thu, 18 Apr 2024 20:26:49 +0300 Subject: [PATCH 1/2] [PE] Fix animation panel --- .../main/app/controller/Animation.js | 16 ++++++++++++++++ .../main/app/controller/DocumentHolder.js | 12 ++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/apps/presentationeditor/main/app/controller/Animation.js b/apps/presentationeditor/main/app/controller/Animation.js index f552d2204a..2ab50e74f9 100644 --- a/apps/presentationeditor/main/app/controller/Animation.js +++ b/apps/presentationeditor/main/app/controller/Animation.js @@ -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 || {})); diff --git a/apps/presentationeditor/main/app/controller/DocumentHolder.js b/apps/presentationeditor/main/app/controller/DocumentHolder.js index d47f5081b8..52a043cc8a 100644 --- a/apps/presentationeditor/main/app/controller/DocumentHolder.js +++ b/apps/presentationeditor/main/app/controller/DocumentHolder.js @@ -493,11 +493,11 @@ define([ } if (event.get_Type() == Asc.c_oAscContextMenuTypes.AnimEffect) { - showPoint[0] += event.get_ButtonWidth() + 2; - showPoint[1] += event.get_ButtonHeight() + 2; + //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; + //showPoint[1] -= event.get_ButtonHeight() + 4; menu.menuAlign = 'br-tr'; } } @@ -948,7 +948,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; From f44e31fbd7f46dd4e7506e30cef1bb7cf6415a66 Mon Sep 17 00:00:00 2001 From: "Julia.Svinareva" Date: Fri, 19 Apr 2024 12:58:49 +0300 Subject: [PATCH 2/2] [PE] Fix animation panel (2) --- .../main/app/controller/DocumentHolder.js | 16 ++++++++++------ .../main/app/view/DocumentHolder.js | 1 - 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/presentationeditor/main/app/controller/DocumentHolder.js b/apps/presentationeditor/main/app/controller/DocumentHolder.js index 52a043cc8a..53f60049a0 100644 --- a/apps/presentationeditor/main/app/controller/DocumentHolder.js +++ b/apps/presentationeditor/main/app/controller/DocumentHolder.js @@ -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'; } } diff --git a/apps/presentationeditor/main/app/view/DocumentHolder.js b/apps/presentationeditor/main/app/view/DocumentHolder.js index a1391e9147..f14c0d4d16 100644 --- a/apps/presentationeditor/main/app/view/DocumentHolder.js +++ b/apps/presentationeditor/main/app/view/DocumentHolder.js @@ -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);