Add a new template for the suggestion item. re #34
This commit is contained in:
parent
7f1f072450
commit
0f63050f70
|
@ -72,7 +72,8 @@
|
||||||
$.get('templates/default/bookdetail.html'),
|
$.get('templates/default/bookdetail.html'),
|
||||||
$.get('templates/default/main.html'),
|
$.get('templates/default/main.html'),
|
||||||
$.get('templates/default/page.html'),
|
$.get('templates/default/page.html'),
|
||||||
$.getJSON(url)).done(function(header, footer, bookdetail, main, page, data){
|
$.get('templates/default/suggestion.html'),
|
||||||
|
$.getJSON(url)).done(function(header, footer, bookdetail, main, page, suggestion, data){
|
||||||
templateBookDetail = doT.template (bookdetail [0]);
|
templateBookDetail = doT.template (bookdetail [0]);
|
||||||
|
|
||||||
var defMain = {
|
var defMain = {
|
||||||
|
@ -89,6 +90,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
templatePage = doT.template (page [0], undefined, defPage);
|
templatePage = doT.template (page [0], undefined, defPage);
|
||||||
|
|
||||||
|
templateSuggestion = doT.template (suggestion [0]);
|
||||||
|
|
||||||
currentData = data [0];
|
currentData = data [0];
|
||||||
|
|
||||||
updatePage (data [0]);
|
updatePage (data [0]);
|
||||||
|
|
1
templates/default/suggestion.html
Normal file
1
templates/default/suggestion.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<p class="{{=it.class}}">{{=it.title}}</p>
|
2
util.js
2
util.js
|
@ -2,7 +2,7 @@
|
||||||
// copyright Sébastien Lucas
|
// copyright Sébastien Lucas
|
||||||
// https://github.com/seblucas/cops
|
// https://github.com/seblucas/cops
|
||||||
|
|
||||||
var templatePage, templateBookDetail, templateMain, currentData, before, filterList;
|
var templatePage, templateBookDetail, templateMain, templateSuggestion, currentData, before, filterList;
|
||||||
|
|
||||||
if (typeof LRUCache!='undefined') {
|
if (typeof LRUCache!='undefined') {
|
||||||
var cache = new LRUCache(30);
|
var cache = new LRUCache(30);
|
||||||
|
|
Loading…
Reference in a new issue