remove manual resiing of panels

pull/1/head
LianaHus 5 years ago
parent 081dc27be3
commit 46c88da08c
  1. 2
      src/app.js
  2. 14
      src/lib/panels-resize.js

@ -141,7 +141,7 @@ class App {
init () {
var self = this
self._components.resizeFeature = new PanelsResize('#side-panel', '#editor-container', { 'minWidth': 300, x: 450 })
self._components.resizeFeature = new PanelsResize('#side-panel', '#editor-container', { 'minWidth': 330, x: 450 })
run.apply(self)
}

@ -99,20 +99,10 @@ export default class PanelsResize {
}
minimize () {
let panel1Width = 0
let panel2left = this.panel1.offsetLeft + panel1Width
let panel2Width = this.panel2.parentElement.clientWidth - this.panel1.offsetLeft - panel1Width
this.panel1.style.width = panel1Width + 'px'
this.panel2.style.left = panel2left + 'px'
this.panel2.style.width = panel2Width + 'px'
this.panel1.style.display = 'none'
}
maximise () {
let panel1Width = this.opt.minWidth
let panel2left = this.panel1.offsetLeft + panel1Width
let panel2Width = this.panel2.parentElement.clientWidth - this.panel1.offsetLeft - panel1Width
this.panel1.style.width = panel1Width + 'px'
this.panel2.style.left = panel2left + 'px'
this.panel2.style.width = panel2Width + 'px'
this.panel1.style.display = 'flex'
}
}

Loading…
Cancel
Save