|
@ -7,36 +7,43 @@ |
|
|
onclick={swipe} |
|
|
onclick={swipe} |
|
|
> |
|
|
> |
|
|
<i |
|
|
<i |
|
|
class="fa fa-bars" |
|
|
class="fa fa-filter" |
|
|
aria-hidden="true" |
|
|
aria-hidden="true" |
|
|
> |
|
|
> |
|
|
</i> |
|
|
</i> |
|
|
</button> |
|
|
</button> |
|
|
<div show={this.swiped !== undefined} style={ this.styles() } class={`animated ${this.swiped !== undefined ? (this.swiped ? "slideInLeft" : "slideOutLeft") : "" } container`}> |
|
|
<div |
|
|
<div style={{"height" : "100%"}} class="columns col-oneline col-gapless"> |
|
|
show={this.swiped !== undefined} |
|
|
|
|
|
style={ this.styles() } |
|
|
<div class="panel column col-11"> |
|
|
id="sidebar" |
|
|
|
|
|
class={`animated ${this.swiped !== undefined ? (this.swiped ? "fadeInLeft" : "fadeOutLeft") : "" } container`} |
|
|
|
|
|
> |
|
|
|
|
|
<div |
|
|
|
|
|
style={{"height" : "100%", "overflow-x" : "hidden"}} |
|
|
|
|
|
class="columns col-oneline col-gapless" |
|
|
|
|
|
> |
|
|
|
|
|
<div style={nobg} class="panel column col-11"> |
|
|
<div class="panel-header"> |
|
|
<div class="panel-header"> |
|
|
<div class="panel-title"> |
|
|
<div class="panel-title"> |
|
|
{ opts.name } |
|
|
{ opts.name } |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div style={panelStyles} class="panel-body"> |
|
|
<div style={R.merge(panelStyles, nobg)} class="panel-body"> |
|
|
<ul class="menu"> |
|
|
<ul style={nobg} class="menu"> |
|
|
|
|
|
|
|
|
<li class="divider" data-content="LINKS"> |
|
|
<li style={R.merge(nobg, subtitle)} class="divider sidebar-divider" data-content="Categories"> |
|
|
</li> |
|
|
</li> |
|
|
|
|
|
|
|
|
<li each={item in opts.items} class="menu-item"> |
|
|
<li style={R.merge(menuStyles, nobg)} each={item in opts.items} class="menu-item"> |
|
|
<a |
|
|
<a |
|
|
class="btn btn-primary menu-button" |
|
|
style={nobg} |
|
|
|
|
|
class="btn btn-primary sidebar-button" |
|
|
href="#" |
|
|
href="#" |
|
|
> |
|
|
> |
|
|
{ item } |
|
|
{ item } |
|
|
</a> |
|
|
</a> |
|
|
<yield/> |
|
|
<yield/> |
|
|
<li class="divider"></li> |
|
|
|
|
|
</li> |
|
|
</li> |
|
|
</ul> |
|
|
</ul> |
|
|
</div> |
|
|
</div> |
|
@ -54,9 +61,15 @@ |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
|
|
|
|
|
|
|
|
|
import { default as jquery } from 'jquery'; |
|
|
import { default as lodash } from 'lodash'; |
|
|
import { default as lodash } from 'lodash'; |
|
|
|
|
|
import { default as R } from 'ramda'; |
|
|
var self = this; |
|
|
var self = this; |
|
|
|
|
|
|
|
|
|
|
|
self.R = R; |
|
|
|
|
|
|
|
|
|
|
|
var background = "rgba(255, 255, 255, 0.95)"; |
|
|
|
|
|
|
|
|
self.open = false; |
|
|
self.open = false; |
|
|
self.swiped = undefined; |
|
|
self.swiped = undefined; |
|
|
|
|
|
|
|
@ -70,44 +83,77 @@ self.swipe = lodash.debounce(() => { |
|
|
|
|
|
|
|
|
self.buttonStyles = (() => { |
|
|
self.buttonStyles = (() => { |
|
|
return { |
|
|
return { |
|
|
"top": "0", |
|
|
"top": "0" |
|
|
"overflow-x": "hidden" |
|
|
|
|
|
}; |
|
|
}; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
self.closedButton = (() => { |
|
|
self.closedButton = (() => { |
|
|
return { |
|
|
return { |
|
|
"background-color" : "rgba(103, 173, 219, 0.40)", |
|
|
"background-color" : background, |
|
|
"font-color" : "black", |
|
|
"font-color" : "black", |
|
|
"height": "50px", |
|
|
"height": "30px", |
|
|
"width": "50px", |
|
|
"width": "30px", |
|
|
"font-size" : "40px", |
|
|
"font-size" : "20px", |
|
|
"position": "fixed", |
|
|
"position": "fixed", |
|
|
"z-index": "1", |
|
|
"z-index": "1", |
|
|
"top": "0", |
|
|
"top": "10px", |
|
|
"left": "0" |
|
|
"left": "10px" |
|
|
}; |
|
|
}; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
self.styles = (() => { |
|
|
self.styles = (() => { |
|
|
return { |
|
|
return { |
|
|
"height": "100%", |
|
|
"box-shadow" : "6px 8px 16px -4px rgba(0,0,0,0.75)", |
|
|
"width": "300px", |
|
|
"-webkit-box-shadow" : "6px 8px 16px -4px rgba(0,0,0,0.75)", |
|
|
|
|
|
"-moz-box-shadow" : "6px 8px 16px -4px rgba(0,0,0,0.75)", |
|
|
|
|
|
"height": "80%", |
|
|
|
|
|
"width": "250px", |
|
|
"position": "fixed", |
|
|
"position": "fixed", |
|
|
"z-index": "1", |
|
|
"z-index": "1", |
|
|
"top": "0", |
|
|
"top": "0", |
|
|
"left": "0", |
|
|
"left": "0", |
|
|
"overflow-x": "hidden", |
|
|
"overflow-x": "hidden", |
|
|
"padding-top": "60px", |
|
|
"padding-top": "60px", |
|
|
"background-color" : "rgba(103, 173, 219, 0.40)" |
|
|
"border" : "1px solid", |
|
|
|
|
|
"background-color" : background |
|
|
}; |
|
|
}; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
self.panelStyles = { |
|
|
self.panelStyles = { |
|
|
"width" : "90%", |
|
|
"width" : "100%", |
|
|
"height" : "100%", |
|
|
"height" : "100%", |
|
|
|
|
|
"margin" : "0 auto", |
|
|
|
|
|
"padding" : "0px 0px 0px 0px" |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
self.menuStyles = { |
|
|
|
|
|
"width" : "100%", |
|
|
"margin" : "0 auto" |
|
|
"margin" : "0 auto" |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
self.nobg = { |
|
|
|
|
|
"background-color" : "transparent", |
|
|
|
|
|
"background" : "none", |
|
|
|
|
|
"border" : "none", |
|
|
|
|
|
"box-shadow" : "none" |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
self.subtitle = { |
|
|
|
|
|
"color" : "#4b93c1", |
|
|
|
|
|
"width" : "100%" |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
self.one("updated", |
|
|
|
|
|
() => { |
|
|
|
|
|
jquery(document).click(function(event) { |
|
|
|
|
|
if(!jquery(event.target).closest('#sidebar').length) { |
|
|
|
|
|
console.log("clicked outside of the sidebar"); |
|
|
|
|
|
if (self.open) { |
|
|
|
|
|
self.swipe(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|
</sidebar> |
|
|
</sidebar> |
|
|