-
Notifications
You must be signed in to change notification settings - Fork 810
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
Zenmode Optional Header and Menubar #1062
Conversation
Mainly looks reasonable, but should it also affect the unhiding behaviour? Perhaps just restoring them to their pre-zen state? Perhaps I'm overthinking this though... |
I don't understand. All the js should do is toggle the |
Well, as it currently stands, the modified version now only hides the menubar/header as set by the config. However, when zen is toggled off again, it will unhide both again (circa line 73), regardless of what state they started in. This could be annoying if, for example, one wished zen to just not affect the menubar at all, and set that independently. Perhaps this level of detail is unimportant though, since in that case I'd have to have been prepared to manually hide/unhide the menubar anyway! |
Anyway, I'm happy to merge as-is, but you'll need a quick release/merge to handle the recent change to config loading 😄 |
I understand what you mean. That could get annoying if I had header hidden, went zen, and then back out of zen to find the header. I unfortunately don't know how to fix this, but this is how Zenmode operates currently anyway, so it's not decreasing functionality. The new config loading breaks the functionality... I am not sure what's going on. Before I just mimicked the config loading of the other options, and it worked fine. |
True, I was being overly picky, this can wait till somebody reports being inconvenienced by it.
Ah... do you mean that the new loading breaks all functionality, or just the bit you've added? Could you push your merged/rebased branch so I can take a look? |
Yeah just the added bits
Done. |
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.
So it looks like rather than merging, you've essentially just gone back to the version before the new config loading mechanism - see individual comments for further details. I can't see an obvious reason why the new behaviour would be broken, but let's get the merge sorted first before we drill down into that!
"base/js/events" | ||
"base/js/events", | ||
'base/js/utils', | ||
'services/config', |
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.
None of this hunk is needed, this was changed for the new config loading mechanism
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.
Apologies, when I said "None of this hunk is needed", I meant "none of the changes in this hunk", we still need the events module 😅
events | ||
events, | ||
utils, | ||
configmod |
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.
Also not needed (see above)
) { | ||
"use_strict"; | ||
|
||
var base_url = utils.get_body_data("baseUrl"); | ||
var config = new configmod.ConfigSection('notebook', {base_url: base_url}); | ||
|
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.
Also unnecessary now we have the new loading mechanism
@@ -139,7 +161,7 @@ define([ | |||
config.data.zenmode_set_zenmode_on_load ? true : false | |||
); | |||
} | |||
}; | |||
}); |
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 change isn't needed.
@@ -156,7 +178,7 @@ define([ | |||
'zenmode-btn-grp' | |||
); | |||
$("#maintoolbar-container").prepend($('#zenmode-btn-grp')); | |||
return IPython.notebook.config.loaded.then(initialize); | |||
config.load(); |
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 change should be reverted
@@ -111,8 +120,21 @@ define([ | |||
if (getZenModeActive() != active) { toggleZenMode(background); } | |||
}; | |||
|
|||
var initialize = function () { | |||
var config = IPython.notebook.config; | |||
config.loaded.then(function() { |
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 (old lines 114,115 replaced by new 123) needs reverting
hide_menubar = false; | ||
} | ||
} | ||
|
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 bit (new lines 124-137) is still fine :)
Sorry. Self taught here. Git is easy to use if you stay in the shallows, but the drop-off is steep. I understand the request now. So I rebased onto the latest commit. I added in the options, and those can be seen in the configurator. This happens due to the yaml file being correct, so that's not surprising.
Working now! Pushed commit. Should be as desired. Also, where can i find the debug log? Reinstalling the extension with |
# Conflicts: # src/jupyter_contrib_nbextensions/nbextensions/zenmode/main.js
…bextensions into zenheadmenu
], function( | ||
require, | ||
$, | ||
IPython, | ||
events |
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.
The events object is needed in new line 107, so this message to go back in. Everything else looks good :)
No worries! Definitely, my apologies, I probably should have provided a better explanation of what I meant!
So, for the JavaScript nbextensions, any useful logs will be in the browser's Thanks for your persistence and patience on this! 😄 |
…bextensions into zenheadmenu
@soamaven apologies for the delay looking at this, but anyway, it looks good now! 👍 |
I tweaked the Zenmode extension to be able to show the header and menubar. I was getting annoyed from having to exit Zenmode everytime I wanted to access the menubar, so I thought I'd make it an option. Did the same for header because it was easy.
Also, from everything I can tell this extension is 5.x compatible.