Skip to content

Commit

Permalink
fix(panel): fix missing calculation on hiding #135
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx committed Jun 8, 2018
1 parent 601852f commit bb5823e
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/content/redux/modules/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -599,18 +599,16 @@ function listenNewSelection (
bowlRect,
}

if (!isPinned) {
newWidgetPartial.panelRect = shouldPanelShow
? _getPanelRectFromEvent(
mouseX,
mouseY,
lastPanelRect.width,
30 + state.dictionaries.active.length * 30,
)
: {
...lastPanelRect,
height: isSaladictPopupPage ? 400 : 30,
}
if (!isPinned && (shouldPanelShow || !lastShouldPanelShow)) {
// don't calculate on hiding to prevent moving animation
newWidgetPartial.panelRect = _getPanelRectFromEvent(
mouseX,
mouseY,
lastPanelRect.width,
shouldPanelShow
? 30 + state.dictionaries.active.length * 30
: isSaladictPopupPage ? 400 : 30,
)
}

dispatch(newSelection(newWidgetPartial))
Expand Down

0 comments on commit bb5823e

Please sign in to comment.