-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
side panel resize #2270
side panel resize #2270
Conversation
@@ -157,22 +156,25 @@ class App { | |||
|
|||
// center panel, resizable | |||
self._view.sidepanel = yo` | |||
<div id="side-panel" class=${css.sidepanel}> | |||
<div id="side-panel" style="min-width: 320px;" class=${css.sidepanel}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set the min-width in CSS. Don't set style inline except if you're modifing it with Javascript.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is done in purpose, I had to do this so I can use in Panel-resize.
src/lib/panels-resize.js
Outdated
this.opt = opt | ||
constructor (panel) { | ||
this.panel = panel | ||
let self = this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove self
src/lib/panels-resize.js
Outdated
let self = this | ||
const string = panel.style.minWidth | ||
this.minWidth = string.length > 2 ? parseInt(string.substring(0, string.length - 2)) : 0 | ||
window.addEventListener('resize', function (event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use arrow function to have acces to this
:
window.addEventListener('resize', (event) => this.setPosition(event))
src/lib/panels-resize.js
Outdated
|
||
var ghostbar = yo`<div class=${css.ghostbar}></div>` | ||
render () { | ||
this.ghostbar = yo`<div class=${css.ghostbar}></div>` | ||
|
||
let mousedown = (event) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use const
src/lib/panels-resize.js
Outdated
@@ -51,58 +47,47 @@ export default class PanelsResize { | |||
|
|||
let cancelGhostbar = (event) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use const
src/lib/panels-resize.js
Outdated
panel1.style.width = p.panel1Width + 'px' | ||
panel2.style.left = p.panel2left + 'px' | ||
panel2.style.width = p.panel2Width + 'px' | ||
let moveGhostbar = (event) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use const
src/lib/panels-resize.js
Outdated
|
||
setPosition(opt) | ||
setPosition (event) { | ||
let panelWidth = this.calculatePanelWidth(event) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't reasign this value, use const
@@ -17,10 +17,10 @@ function checkFilter (browser, filter, test, done) { | |||
done() | |||
return | |||
} | |||
var filterClass = '#editor-container div[class^="search"] input[class^="filter"]' | |||
var filterClass = '#main-panel div[class^="search"] input[class^="filter"]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use const
No description provided.