6 changed files with 89 additions and 6 deletions
@ -1,3 +1,5 @@ |
|||
<aboutview> |
|||
<h3>wat</h3> |
|||
<p> |
|||
Created as an experiment in allowing students to find public domain copies of books for their courses easier |
|||
</p> |
|||
</aboutview> |
|||
|
@ -1,10 +1,59 @@ |
|||
<app> |
|||
<ul class="tab tab-block"> |
|||
<li class={"tab-item " + this.searchActive}> |
|||
<a onclick={toSearch} href="">Search</a> |
|||
</li> |
|||
<li class={"tab-item " + this.aboutActive}> |
|||
<a onclick={toAbout} href="/about">About</a> |
|||
</li> |
|||
</ul> |
|||
<router> |
|||
<route path="/search"> |
|||
<searchview></searchview> |
|||
<route path="/"> |
|||
<div class="animated fadeIn"> |
|||
<searchview></searchview> |
|||
</div> |
|||
</route> |
|||
<route path="/about"> |
|||
<aboutview></aboutview> |
|||
<div class="animated fadeIn"> |
|||
<aboutview></aboutview> |
|||
</div> |
|||
</route> |
|||
</router> |
|||
<script> |
|||
import route from 'riot-route'; |
|||
this.route = route; |
|||
|
|||
this.searchActive = ""; |
|||
this.aboutActive = ""; |
|||
var self = this; |
|||
|
|||
this.route("about", |
|||
function() { |
|||
self.aboutActive = "active"; |
|||
self.searchActive = ""; |
|||
self.update(); |
|||
}); |
|||
|
|||
this.route("/", |
|||
function() { |
|||
self.aboutActive = ""; |
|||
self.searchActive = "active"; |
|||
self.update(); |
|||
}); |
|||
|
|||
|
|||
toAbout(e) { |
|||
e.preventDefault(); |
|||
this.route("about"); |
|||
return; |
|||
} |
|||
|
|||
toSearch(e) { |
|||
e.preventDefault(); |
|||
this.route(""); |
|||
return; |
|||
} |
|||
|
|||
|
|||
</script> |
|||
</app> |
|||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue