Title now moves with sidebar

This commit is contained in:
Dominik Süß 2016-10-24 22:54:44 +02:00 committed by Simon Michael
parent cb79e01880
commit 9dab7c4148
2 changed files with 4 additions and 1 deletions

View File

@ -46,7 +46,7 @@ hledgerLayout vd title content = do
-- | Global toolbar/heading area. -- | Global toolbar/heading area.
topbar :: ViewData -> HtmlUrl AppRoute topbar :: ViewData -> HtmlUrl AppRoute
topbar VD{..} = [hamlet| topbar VD{..} = [hamlet|
<div#spacer .col-md-4 .col-sm-4 .col-xs-2> <div#spacer .#{showsm} .#{showmd} .col-xs-2>
<h1> <h1>
<button .visible-xs .btn .btn-default type="button" data-toggle="offcanvas"> <button .visible-xs .btn .btn-default type="button" data-toggle="offcanvas">
<span .glyphicon .glyphicon-align-left .tgl-icon> <span .glyphicon .glyphicon-align-left .tgl-icon>
@ -56,6 +56,8 @@ topbar VD{..} = [hamlet|
|] |]
where where
title = takeFileName $ journalFilePath j title = takeFileName $ journalFilePath j
showmd = if showsidebar then "col-md-4" else "col-any-0" :: String
showsm = if showsidebar then "col-sm-4" else "" :: String
-- | The sidebar used on most views. -- | The sidebar used on most views.
sidebar :: ViewData -> HtmlUrl AppRoute sidebar :: ViewData -> HtmlUrl AppRoute

View File

@ -223,6 +223,7 @@ function addformDeletePosting() {
function sidebarToggle() { function sidebarToggle() {
$('#sidebar-menu').toggleClass('col-md-4 col-sm-4 col-any-0'); $('#sidebar-menu').toggleClass('col-md-4 col-sm-4 col-any-0');
$('#main-content').toggleClass('col-md-8 col-sm-8 col-md-12 col-sm-12'); $('#main-content').toggleClass('col-md-8 col-sm-8 col-md-12 col-sm-12');
$('#spacer').toggleClass('col-md-4 col-sm-4 col-any-0');
$.cookie('showsidebar', $('#sidebar-menu').hasClass('col-any-0') ? '0' : '1'); $.cookie('showsidebar', $('#sidebar-menu').hasClass('col-any-0') ? '0' : '1');
} }