Newer
Older
/* Copyright (c) 2010-2011, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
//= require jquery.autoSuggest.custom
$(document).on('click', '.conversation-wrapper', function(){
var conversation_path = $(this).data('conversation-path');
$.getScript(conversation_path, function() {
history.pushState(null, "", conversation_path);
cBadge = $("#conversations_badge .badge_count");
cBadge.html().replace(/\d+/, function(num){
num = parseInt(num);
cBadge.html(parseInt(num)-1);
if(num == 1) {
cBadge.addClass("hidden");
}
});
}
if (location.href.match(/conversations\/\d+/) !== null) {
});
$('#conversation_inbox .stream').infinitescroll({
navSelector : ".pagination",
// selector for the paged navigation (it will be hidden)
nextSelector : ".pagination a.next_page",
// selector for the NEXT link (to page 2)
itemSelector : "#conversation_inbox .conversation",
// selector for all items you'll retrieve
localMode: true,
debug: false,
donetext: "no more.",
loadingText: "",
$('.conversation-wrapper', '.stream').bind('mousedown', function(){
bindIt($(this));
});
});
// kill scroll binding
$(window).unbind('.infscr');
// hook up the manual click guy.
$('a.next_page').click(function(){
$(document).trigger('retrieve.infscr');
return false;
});
// remove the paginator when we're done.
$(document).ajaxError(function(e,xhr,opt){