|
@@ -543,25 +543,28 @@ MaterioSearchApiAjax = function(){
|
|
|
};
|
|
|
|
|
|
function addNextpage(json, container_class){
|
|
|
- var $newcontent = $(json.return),
|
|
|
- $newitems = $(container_class, $newcontent).children('article'), //.addClass('just-added'),
|
|
|
- $newpager = $('ul.pager', $newcontent);
|
|
|
-
|
|
|
- $(container_class, _$content).append($newitems);
|
|
|
- $('ul.pager', _$content).replaceWith($newpager.hide());
|
|
|
-
|
|
|
- // TODO: animation, this should be on theme side
|
|
|
- $(container_class, _$content).children('.just-added').each(function(i){
|
|
|
- var $this = $(this);
|
|
|
- setTimeout(function(){
|
|
|
- $this.removeClass('just-added');
|
|
|
- }, 150*i);
|
|
|
- });
|
|
|
+ // trace('json',json);
|
|
|
+ if(json){
|
|
|
+ var $newcontent = $(json.return),
|
|
|
+ $newitems = $(container_class, $newcontent).children('article'), //.addClass('just-added'),
|
|
|
+ $newpager = $('ul.pager', $newcontent);
|
|
|
+
|
|
|
+ $(container_class, _$content).append($newitems);
|
|
|
+ $('ul.pager', _$content).replaceWith($newpager.hide());
|
|
|
+
|
|
|
+ // TODO: animation, this should be on theme side
|
|
|
+ $(container_class, _$content).children('.just-added').each(function(i){
|
|
|
+ var $this = $(this);
|
|
|
+ setTimeout(function(){
|
|
|
+ $this.removeClass('just-added');
|
|
|
+ }, 150*i);
|
|
|
+ });
|
|
|
|
|
|
- $.event.trigger({
|
|
|
- type : 'resultscompleted',
|
|
|
- container : $(container_class, _$content)
|
|
|
- });
|
|
|
+ $.event.trigger({
|
|
|
+ type : 'resultscompleted',
|
|
|
+ container : $(container_class, _$content)
|
|
|
+ });
|
|
|
+ }
|
|
|
_isloadingresults = false;
|
|
|
};
|
|
|
|