Skip to content

Commit

Permalink
fix(script): 修复添加额外菜单栏后,窗口无法正常最大化/最小化的BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
ennnncy committed Mar 28, 2024
1 parent b70962c commit 22c45bc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
9 changes: 8 additions & 1 deletion packages/core/src/render/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,14 @@ export function $menu(label: string, config: { scriptPanelLink?: ScriptIdentify
const btn = el('button', label);
btn.addEventListener('click', () => {
if (config.scriptPanelLink) {
RenderScript.methods.pin(config.scriptPanelLink);
// 置顶脚本页面
RenderScript.methods
.pin(config.scriptPanelLink)
.then(() => {
// 最大化窗口
RenderScript.methods.normal();
})
.catch(console.error);
}
});
if (config.scriptPanelLink) {
Expand Down
4 changes: 2 additions & 2 deletions packages/scripts/assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -700,11 +700,11 @@ modal-element.confirm .modal-input {
margin-left: 0.25em;
}
.minimize .body,
.minimize .header .dropdown,
.minimize header-element .dropdown,
.minimize .footer {
display: none;
}
.minimize .header {
.minimize header-element {
padding: 8px;
border-radius: 8px;
box-shadow: 0px 0px 24px -12px black;
Expand Down
4 changes: 2 additions & 2 deletions packages/scripts/assets/less/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -619,13 +619,13 @@ modal-element.confirm {

.minimize {
.body,
.header .dropdown,
header-element .dropdown,
.footer {
display: none;
}
}

.minimize .header {
.minimize header-element {
padding: 8px;
border-radius: 8px;
box-shadow: 0px 0px 24px -12px black;
Expand Down

0 comments on commit 22c45bc

Please sign in to comment.