6 changed files with 89 additions and 6 deletions
@ -1,3 +1,5 @@ |
|||||
<aboutview> |
<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> |
</aboutview> |
||||
|
@ -1,10 +1,59 @@ |
|||||
<app> |
<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> |
<router> |
||||
<route path="/search"> |
<route path="/"> |
||||
<searchview></searchview> |
<div class="animated fadeIn"> |
||||
|
<searchview></searchview> |
||||
|
</div> |
||||
</route> |
</route> |
||||
<route path="/about"> |
<route path="/about"> |
||||
<aboutview></aboutview> |
<div class="animated fadeIn"> |
||||
|
<aboutview></aboutview> |
||||
|
</div> |
||||
</route> |
</route> |
||||
</router> |
</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> |
</app> |
||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue