|
@@ -49,7 +49,7 @@
|
|
}
|
|
}
|
|
return false;
|
|
return false;
|
|
},
|
|
},
|
|
- template = window.template = function(type,name,template){
|
|
+ template = window.template = function(type,name,template,hash){
|
|
var id = (function(type,name){
|
|
var id = (function(type,name){
|
|
for(var i in templates){
|
|
for(var i in templates){
|
|
if(templates[i].name == name && templates[i].type == type){
|
|
if(templates[i].name == name && templates[i].type == type){
|
|
@@ -353,6 +353,7 @@
|
|
var t = $(this);
|
|
var t = $(this);
|
|
if(!$.hasData(t)){
|
|
if(!$.hasData(t)){
|
|
t.data('type',t.text().trim());
|
|
t.data('type',t.text().trim());
|
|
|
|
+ t.data('at',t.prev().children().length);
|
|
t.text('Load More');
|
|
t.text('Load More');
|
|
}
|
|
}
|
|
}).click(function(){
|
|
}).click(function(){
|
|
@@ -366,7 +367,7 @@
|
|
topbar: false,
|
|
topbar: false,
|
|
no_state: true,
|
|
no_state: true,
|
|
of: t.data('type'),
|
|
of: t.data('type'),
|
|
- at: Number(t.children().length)+10
|
|
+ at: Number(t.data('at'))
|
|
};
|
|
};
|
|
data.start = t.data('at');
|
|
data.start = t.data('at');
|
|
apiCall(data,function(d){
|
|
apiCall(data,function(d){
|
|
@@ -382,6 +383,7 @@
|
|
}
|
|
}
|
|
render.refresh(t.prev());
|
|
render.refresh(t.prev());
|
|
}
|
|
}
|
|
|
|
+ t.data('at',t.prev().children().length);
|
|
},true);
|
|
},true);
|
|
}).button();
|
|
}).button();
|
|
render.comment.buttons(selector);
|
|
render.comment.buttons(selector);
|
|
@@ -694,12 +696,7 @@
|
|
id: type,
|
|
id: type,
|
|
name: d.manifest[i].name
|
|
name: d.manifest[i].name
|
|
},function(d){
|
|
},function(d){
|
|
- templates.push({
|
|
+ template(d.type,d.name,d.template,d.hash);
|
|
- name: d.name,
|
|
|
|
- template: d.template,
|
|
|
|
- type: d.type,
|
|
|
|
- hash: d.hash
|
|
|
|
- });
|
|
|
|
$.localStorage('templates',templates);
|
|
$.localStorage('templates',templates);
|
|
count--;
|
|
count--;
|
|
console.log('Loaded template('+count+' left): '+d.name);
|
|
console.log('Loaded template('+count+' left): '+d.name);
|