Commit 9208e3b2 authored by Romain Casati's avatar Romain Casati
Browse files

Menubar and toolbar now get properly triggered.

parent 9be11c7e
Pipeline #399863 passed with stages
in 3 minutes and 5 seconds
...@@ -600,16 +600,9 @@ define([ ...@@ -600,16 +600,9 @@ define([
cmd: i18n.msg._('toggle header'), cmd: i18n.msg._('toggle header'),
help: i18n.msg._('switch between showing and hiding the header'), help: i18n.msg._('switch between showing and hiding the header'),
handler : function(env) { handler : function(env) {
var value = !env.notebook.header; $('#header-container').toggle();
if (value === true) { $('.header-bar').toggle();
$('#header-container').show();
$('.header-bar').show();
} else if (value === false) {
$('#header-container').hide();
$('.header-bar').hide();
}
events.trigger('resize-header.Page'); events.trigger('resize-header.Page');
env.notebook.header = value;
} }
}, },
'show-header':{ 'show-header':{
...@@ -619,7 +612,6 @@ define([ ...@@ -619,7 +612,6 @@ define([
$('#header-container').show(); $('#header-container').show();
$('.header-bar').show(); $('.header-bar').show();
events.trigger('resize-header.Page'); events.trigger('resize-header.Page');
env.notebook.header = true;
} }
}, },
'hide-header':{ 'hide-header':{
...@@ -629,7 +621,6 @@ define([ ...@@ -629,7 +621,6 @@ define([
$('#header-container').hide(); $('#header-container').hide();
$('.header-bar').hide(); $('.header-bar').hide();
events.trigger('resize-header.Page'); events.trigger('resize-header.Page');
env.notebook.header = false;
} }
}, },
'toggle-menubar':{ 'toggle-menubar':{
...@@ -657,14 +648,8 @@ define([ ...@@ -657,14 +648,8 @@ define([
cmd: i18n.msg._('toggle toolbar'), cmd: i18n.msg._('toggle toolbar'),
help: i18n.msg._('switch between showing and hiding the toolbar'), help: i18n.msg._('switch between showing and hiding the toolbar'),
handler : function(env) { handler : function(env) {
var value = !env.notebook.toolbar; $('div#maintoolbar').toggle();
if (value === true) {
$('div#maintoolbar').show();
} else if (value === false) {
$('div#maintoolbar').hide();
}
events.trigger('resize-header.Page'); events.trigger('resize-header.Page');
env.notebook.toolbar = value;
} }
}, },
'show-toolbar':{ 'show-toolbar':{
...@@ -673,7 +658,6 @@ define([ ...@@ -673,7 +658,6 @@ define([
handler : function(env) { handler : function(env) {
$('div#maintoolbar').show(); $('div#maintoolbar').show();
events.trigger('resize-header.Page'); events.trigger('resize-header.Page');
env.notebook.toolbar = true;
} }
}, },
'hide-toolbar':{ 'hide-toolbar':{
...@@ -682,7 +666,6 @@ define([ ...@@ -682,7 +666,6 @@ define([
handler : function(env) { handler : function(env) {
$('div#maintoolbar').hide(); $('div#maintoolbar').hide();
events.trigger('resize-header.Page'); events.trigger('resize-header.Page');
env.notebook.toolbar = false;
} }
}, },
'close-pager': { 'close-pager': {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment