Browse Source

fix bug where booktitle would disappear

master
wes 9 years ago
parent
commit
a206a5a2e8
  1. 24
      src/scripts/book.tag
  2. 7
      src/scripts/class.tag

24
src/scripts/book.tag

@ -1,29 +1,27 @@
<book> <book>
<div class="text-clip toast"> <div class="text-clip toast">
<p> <p>
<dt class="book-title text-center"> <button onclick={getresources} class="btn btn-link">
<button onclick={getresources} class="btn btn-link"> { booktitle }
{ title } </button>
</button>
</dt>
<dd> <dd>
<div if={ loading } class="loading"> <div if={ loading } class="loading">
</div> </div>
<p if={ this.iarchive }> <p if={ iarchive }>
<a target="_blank" href="{ iarchive }"> <a target="_blank" href="{ iarchive }">
<button class="centered btn btn-link"> <button class="centered btn btn-link">
Internet Archive Result Internet Archive Result
</button> </button>
</a> </a>
</p> </p>
<p if={ this.openlib }> <p if={ openlib }>
<a target="_blank" href="{ openlib }"> <a target="_blank" href="{ openlib }">
<button class="centered btn btn-link"> <button class="centered btn btn-link">
Open Library Result Open Library Result
</button> </button>
</a> </a>
</p> </p>
<p class="centered wraptext" if={ noresources }> <p if={ noresources } class="centered wraptext">
Couldn't find anything, sorry :( Couldn't find anything, sorry :(
</p> </p>
</dd> </dd>
@ -36,12 +34,13 @@ this.noresources = false;
var self = this; var self = this;
getresources() { getresources(ev) {
ev.preventDefault();
self.loading = true; self.loading = true;
self.update(); self.update();
var params = { var params = {
"title" : this.booktitle, "title" : self.booktitle,
"author" : this.bookauthor "author" : self.bookauthor
}; };
var url = "/search/resources"; var url = "/search/resources";
@ -60,7 +59,8 @@ getresources() {
self.noresources = true; self.noresources = true;
} }
self.update({"loading" : false}); self.loading = false;
self.update();
}); });
} }

7
src/scripts/class.tag

@ -11,12 +11,7 @@
</button> </button>
<div if={ this.booksshown }> <div if={ this.booksshown }>
<dl> <dl>
<book each={ books } <book each={ books } data="{ this }">
data="{ this }"
resources=""
title={ booktitle }
author={ bookauthor }
price={ bookprice }>
</book> </book>
</dl> </dl>
</div> </div>

Loading…
Cancel
Save