Sidebar now works again
This commit is contained in:
		
							parent
							
								
									b29efba09d
								
							
						
					
					
						commit
						ab2ebbbcad
					
				| @ -36,7 +36,7 @@ hledgerLayout vd title content = do | |||||||
|       toWidget [hamlet| |       toWidget [hamlet| | ||||||
|          ^{topbar vd} |          ^{topbar vd} | ||||||
|          ^{sidebar vd} |          ^{sidebar vd} | ||||||
|          <div .col-md-8 .col-xs-12 .col-sm-12> |          <div #main-content .col-md-8 .col-xs-12 .col-sm-12> | ||||||
|           ^{searchform vd} |           ^{searchform vd} | ||||||
|           ^{content} |           ^{content} | ||||||
|       |] |       |] | ||||||
|  | |||||||
| @ -157,3 +157,23 @@ ul { | |||||||
| .negative { | .negative { | ||||||
|     color: #a94442; |     color: #a94442; | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | #main-content { | ||||||
|  |     -webkit-transition: width 0.3s ease, margin 0.3s ease; | ||||||
|  |     -moz-transition: width 0.3s ease, margin 0.3s ease; | ||||||
|  |     -o-transition: width 0.3s ease, margin 0.3s ease; | ||||||
|  |     transition: width 0.3s ease, margin 0.3s ease; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | #sidebar-menu { | ||||||
|  |     -webkit-transition: width 0.3s ease, margin 0.3s ease; | ||||||
|  |     -moz-transition: width 0.3s ease, margin 0.3s ease; | ||||||
|  |     -o-transition: width 0.3s ease, margin 0.3s ease; | ||||||
|  |     transition: width 0.3s ease, margin 0.3s ease; | ||||||
|  |     overflow:hidden; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .col-any-0 { | ||||||
|  |     width:0 !important; | ||||||
|  |     float: left; | ||||||
|  | } | ||||||
|  | |||||||
| @ -218,21 +218,8 @@ function addformDeletePosting() { | |||||||
| // SIDEBAR
 | // SIDEBAR
 | ||||||
| 
 | 
 | ||||||
| function sidebarToggle() { | function sidebarToggle() { | ||||||
|   var visible = $('#sidebar').is(':visible'); |   $('#sidebar-menu').toggleClass('col-md-4 col-any-0'); | ||||||
|   // if opening sidebar, start an ajax fetch of its content
 |   $('#main-content').toggleClass('col-md-8 col-md-12'); | ||||||
|   if (!visible) { |  | ||||||
|     $.get("sidebar" |  | ||||||
|          ,null |  | ||||||
|          ,function(data) { |  | ||||||
|             $("#sidebar-body" ).html(data); |  | ||||||
|           }) |  | ||||||
|           .fail(function() { |  | ||||||
|             alert("Loading the sidebar did fail"); |  | ||||||
|           }); |  | ||||||
|   } |  | ||||||
|   // set a cookie to communicate the new sidebar state to the server
 |  | ||||||
|   $.cookie('showsidebar', visible ? '0' : '1'); |  | ||||||
|   $('#sidebar').animate({'width': visible ? 'hide' : 'show'}); |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| //----------------------------------------------------------------------
 | //----------------------------------------------------------------------
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user