actuality bug fix

Signed-off-by: bachy <git@g-u-i.net>
This commit is contained in:
bachy
2013-02-14 21:24:22 +01:00
parent 7a3ee63d15
commit f0f9635e8b
4 changed files with 42 additions and 36 deletions

View File

@@ -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);
// 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());
$(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);
});
// 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;
};

View File

@@ -206,25 +206,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);
// 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());
$(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);
});
// 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;
};