There are a few more places to patch the code into and building minified 
JS. Will test this later US EDT and if it works, I will make a PR.

On Thursday, April 6, 2017 at 7:46:39 AM UTC-4, takowl wrote:
>
> That code looks reasonable. Have you tested it? Do you want to make a PR?
>
> On 5 April 2017 at 22:39, Milos Miljkovic <[email protected] 
> <javascript:>> wrote:
>
>> Hi,
>>
>> If I wanted to add a custom notebook action for showing/hiding/toggling 
>> menu bar, would including the code below 
>> into /notebook/static/notebook/js/actions.js work and correctly add entry 
>> to /.jupyter/nbconfig/notebook.json if a custom keyboard shortcut was 
>> created?
>>
>>
>> 'toggle-menubar':{
>>     help: 'hide/show the menu bar',
>>     handler : function(env) {
>>         var value = !env.notebook.menubar;
>>         if (value === true) {
>>             $('#menubar-container').show();
>>         } else if (value === false) {
>>             $('#menubar-container').hide();
>>         }
>>         events.trigger('resize-header.Page');
>>         env.notebook.menubar = value;
>>     }
>> },
>> 'show-menubar':{
>>     help: 'show the menu bar',
>>     handler : function(env) {
>>         $('#menubar-container').show();
>>         events.trigger('resize-header.Page');
>>         env.notebook.menubar = true;
>>     }
>> },
>> 'hide-menubar':{
>>     help: 'hide the menu bar',
>>     handler : function(env) {
>>         $('#menubar-container').hide();
>>         events.trigger('resize-header.Page');
>>         env.notebook.menubar = false;
>>     }
>> },
>>
>>
>> Cheers,
>>
>> Milos.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Project Jupyter" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jupyter/0acf4c0d-183d-460e-a13d-9273be1581b4%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jupyter/0acf4c0d-183d-460e-a13d-9273be1581b4%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/fa6b3cbd-2895-4043-bc88-a5c20ddbeb2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to