Skip to content

fix(ExPanel): 修复浮动面板定位和 toolbar 样式问题#152

Open
JiangQianJiang wants to merge 5 commits into
qianjiachun:masterfrom
JiangQianJiang:master
Open

fix(ExPanel): 修复浮动面板定位和 toolbar 样式问题#152
JiangQianJiang wants to merge 5 commits into
qianjiachun:masterfrom
JiangQianJiang:master

Conversation

@JiangQianJiang

Copy link
Copy Markdown

Summary

  • 修复 ExPanel 在 position:fixed 下因 CSS transform 导致的定位失效
  • 统一浮动参考点为 vtoolbarMenu
  • 修复 Refresh 流程中 toolbar 内联样式被覆盖的问题

Test plan

  • 直播间打开精灵球面板,确认位置正确
  • 刷新后再次打开面板,确认位置不偏移

…rm breaking position:fixed

- ExPanel_getFloatingHost() now returns document.body to prevent player container CSS transform from creating a new containing block that breaks position:fixed
- ExPanel_restoreToGiftBar() now resets floating inline styles and recalculates gift-bar positioning
…m entirely

`style = "z-index:30"` was wiping all inline styles on #js-player-toolbar,
removing positioning (e.g. `position: absolute; bottom: 0`) set by Douyu's
native JS. This caused ExPanel_updateFloatingPosition to calculate the
panel position from a wrong toolbar rect, placing the panel at the top
of the video area instead of 8px above the toolbar.

Changed all `style = "..."` assignments to targeted property assignments
(e.g. `style.zIndex = "30"`).
…ayer-toolbar

js-player-toolbar wraps the entire player area so its top is in the middle
of the viewport, not at the bottom. The Pokeball button (ex-vtoolbar-menu)
is inside the actual bottom control bar and gives correct positioning.
…ition

js-player-toolbar wraps the entire player area, not just the bottom
control bar. On beta layout its top is in the middle of the viewport,
so the panel was placed too high. Use the Pokeball button position
instead, which is reliably at the bottom control bar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant