login redirects back

This commit is contained in:
Baris Usakli
2013-09-24 14:56:51 -04:00
parent 8f04a136c8
commit 83d5a84edd
6 changed files with 143 additions and 122 deletions

View File

@@ -215,21 +215,12 @@
}, false);
}
$(window).off('scroll').on('scroll', function() {
var bottom = ($(document).height() - $(window).height()) * 0.9;
if ($(window).scrollTop() > bottom && !app.infiniteLoaderActive && $('#post-container').children().length) {
app.loadMorePosts(tid);
}
});
enableInfiniteLoading();
var bookmark = localStorage.getItem('topic:' + tid + ':bookmark');
if(bookmark) {
// need to find out why it doesnt work without setTimeout -baris
setTimeout(function() {
app.scrollToPost(parseInt(bookmark, 10));
}, 300);
app.scrollToPost(parseInt(bookmark, 10));
}
$('#post-container').on('click', '.deleted', function(ev) {
@@ -237,6 +228,17 @@
});
});
function enableInfiniteLoading() {
$(window).off('scroll').on('scroll', function() {
var bottom = ($(document).height() - $(window).height()) * 0.9;
if ($(window).scrollTop() > bottom && !app.infiniteLoaderActive && $('#post-container').children().length) {
app.loadMorePosts(tid);
console.log('window scrolling');
}
});
}
var reply_fn = function() {
var selectionText = '',
selection = window.getSelection() || document.getSelection();