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? |
…bextensions into zenheadmenu
Yeah just the added bits
Done. |
jcb91
left a comment
There was a problem hiding this comment.
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.
None of this hunk is needed, this was changed for the new config loading mechanism
There was a problem hiding this comment.
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 |
|
|
||
| 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.
Also unnecessary now we have the new loading mechanism
| ); | ||
| } | ||
| }; | ||
| }); |
| ); | ||
| $("#maintoolbar-container").prepend($('#zenmode-btn-grp')); | ||
| return IPython.notebook.config.loaded.then(initialize); | ||
| config.load(); |
|
|
||
| var initialize = function () { | ||
| var config = IPython.notebook.config; | ||
| config.loaded.then(function() { |
There was a problem hiding this comment.
This (old lines 114,115 replaced by new 123) needs reverting
| hide_menubar = false; | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
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
| require, | ||
| $, | ||
| IPython, | ||
| events |
There was a problem hiding this comment.
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.