Skip to content
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

Merged
merged 4 commits into from
Aug 20, 2019
Merged

side panel resize #2270

merged 4 commits into from
Aug 20, 2019

Conversation

LianaHus
Copy link
Collaborator

No description provided.

@@ -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}>
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

this.opt = opt
constructor (panel) {
this.panel = panel
let self = this
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove self

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) {
Copy link
Collaborator

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))


var ghostbar = yo`<div class=${css.ghostbar}></div>`
render () {
this.ghostbar = yo`<div class=${css.ghostbar}></div>`

let mousedown = (event) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use const

@@ -51,58 +47,47 @@ export default class PanelsResize {

let cancelGhostbar = (event) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use const

panel1.style.width = p.panel1Width + 'px'
panel2.style.left = p.panel2left + 'px'
panel2.style.width = p.panel2Width + 'px'
let moveGhostbar = (event) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use const


setPosition(opt)
setPosition (event) {
let panelWidth = this.calculatePanelWidth(event)
Copy link
Collaborator

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"]'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use const

@yann300 yann300 merged commit fe101a5 into master Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants