Skip to content

Commit

Permalink
fix maximize panel
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 authored and Aniket-Engg committed Sep 16, 2024
1 parent 04febb1 commit 5ab1e33
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
16 changes: 14 additions & 2 deletions apps/remix-ide/src/app/panels/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ export class Layout extends Plugin {
const current = await this.call('sidePanel', 'currentFocus')
if (this.enhanced[current]) {
this.event.emit('enhancesidepanel')
} else {
}

if (this.maximized[current]) {
this.event.emit('maximisesidepanel')
}

if (!this.enhanced[current] && !this.maximized[current]) {
this.event.emit('resetsidepanel')
}
})
Expand All @@ -94,7 +100,13 @@ export class Layout extends Plugin {
const current = await this.call('pinnedPanel', 'currentFocus')
if (this.enhanced[current]) {
this.event.emit('enhancepinnedpanel')
} else {
}

if (this.maximized[current]) {
this.event.emit('maximisepinnedpanel')
}

if (!this.enhanced[current] && !this.maximized[current]) {
this.event.emit('resetpinnedpanel')
}
})
Expand Down
20 changes: 8 additions & 12 deletions libs/remix-ui/app/src/lib/remix-app/components/dragbar/dragbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,17 @@ const DragBar = (props: IRemixDragBarUi) => {
if (layoutPosition === 'left') {
const width = coeff * window.innerWidth

if (width > refObject.current.offsetWidth) {
props.refObject.current.style.width = width + 'px'
setTimeout(() => {
setDragBarPosX(offset + width)
}, 300)
}
props.refObject.current.style.width = width + 'px'
setTimeout(() => {
setDragBarPosX(offset + width)
}, 300)
} else if (layoutPosition === 'right') {
const width = coeff * window.innerWidth

if (width > refObject.current.offsetWidth) {
refObject.current.style.width = width + 'px'
setTimeout(() => {
setDragBarPosX(window.innerWidth - width)
}, 300)
}
refObject.current.style.width = width + 'px'
setTimeout(() => {
setDragBarPosX(window.innerWidth - width)
}, 300)
}
}
}
Expand Down

0 comments on commit 5ab1e33

Please sign in to comment.