pull/1857/head
bunsenstraat 3 years ago
parent 13bffe1743
commit 812728ca5b
  1. 1
      apps/remix-ide/src/app/components/hidden-panel.tsx
  2. 1
      apps/remix-ide/src/app/panels/layout.ts
  3. 1
      apps/remix-ide/src/app/panels/tab-proxy.js
  4. 21
      libs/remix-ui/app/src/lib/remix-app/dragbar/dragbar.tsx

@ -28,7 +28,6 @@ export class HiddenPanel extends AbstractPanel {
} }
render () { render () {
console.log(this.el)
return this.el return this.el
} }

@ -30,7 +30,6 @@ export class Layout extends Plugin {
} }
async onActivation (): Promise<void> { async onActivation (): Promise<void> {
console.log('layout plugin activated')
this.on('fileManager', 'currentFileChanged', () => { this.on('fileManager', 'currentFileChanged', () => {
this.panels.editor.active = true this.panels.editor.active = true
this.panels.main.active = false this.panels.main.active = false

@ -210,7 +210,6 @@ export class TabProxy extends Plugin {
} }
addTab (name, title, switchTo, close, icon) { addTab (name, title, switchTo, close, icon) {
console.log('add tab', name)
if (this._handlers[name]) return this.renderComponent() if (this._handlers[name]) return this.renderComponent()
var slash = name.split('/') var slash = name.split('/')

@ -15,18 +15,23 @@ const DragBar = (props: IRemixDragBarUi) => {
const [offset, setOffSet] = useState<number>(0) const [offset, setOffSet] = useState<number>(0)
const nodeRef = React.useRef(null) // fix for strictmode const nodeRef = React.useRef(null) // fix for strictmode
useEffect(() => {
// arbitrary time out to wait the the UI to be completely done
setTimeout(() => {
setOffSet(props.refObject.current.offsetLeft)
setDragBarPosX(offset + props.refObject.current.offsetWidth)
}, 1000)
}, [])
useEffect(() => { useEffect(() => {
setDragBarPosX(offset + (props.hidden ? 0 : props.refObject.current.offsetWidth)) setDragBarPosX(offset + (props.hidden ? 0 : props.refObject.current.offsetWidth))
}, [props.hidden, offset]) }, [props.hidden, offset])
const handleResize = () => {
setOffSet(props.refObject.current.offsetLeft)
setDragBarPosX(props.refObject.current.offsetLeft + props.refObject.current.offsetWidth)
}
useEffect(() => {
window.addEventListener('resize', handleResize)
// TODO: not a good way to wait on the ref doms element to be rendered of course
setTimeout(() =>
handleResize(), 2000)
return () => window.removeEventListener('resize', handleResize)
}, [])
function stopDrag (e: MouseEvent, data: any) { function stopDrag (e: MouseEvent, data: any) {
setDragState(false) setDragState(false)
if (data.x < props.minWidth) { if (data.x < props.minWidth) {

Loading…
Cancel
Save