-
Notifications
You must be signed in to change notification settings - Fork 97
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
Remember panel height when creating it #32
Conversation
I didn't get around to give this a whirl yet, but just looking at the code it seems as the build panel will attach regardless of the I'll check this out in more depth tomorrow. Thanks for your contribution! |
It will attach, yeah, but then it'll also detach once It seems like there might be a problem with double attach though (if |
@@ -17,6 +17,7 @@ module.exports = (function() { | |||
this.titleLoopIndex = 0; | |||
this.a2h = new Convert(); | |||
this.monocle = false; | |||
this.attach(); |
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.
Is you acutely pointed out, when we call atom.config.observe
with the keepVisible argument, visibleFromConfig
will be called with the current choice the user have. This attach is not necessary then, because it will be either attach or detach att that point.
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.
But then if we remove this attach this.height
will be uninitialized when minimizedHeight
gets loaded from the config.
The whole point was that we need to get the height of the panel while it still exists beacuse otherwise the height will be 0
. And since the panel might not have been ever made visible prior to reading minimizedHeight
we need to explicitly create it somewhere.
Changing the order of observe
calls might work too I guess, but this seemed more reliable and I wasn't sure if they are synchronous or not.
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.
Ah. I see.
You are correct. I think this is the best way too, and it works well. Thanks!
The problem with multiple attach, if it is that the |
Remember panel height when creating it
Thanks! I will include this in next release (v0.23.0). |
Fixes #31