Fixed issue with masstag in endless scrolling mode

This commit is contained in:
Marcin Kurczewski 2013-11-05 09:17:44 +01:00
parent b093a090eb
commit 09b5a38c95
3 changed files with 107 additions and 84 deletions

View file

@ -1,3 +1,4 @@
//core functionalities, prototypes
$.fn.hasAttr = function(name) $.fn.hasAttr = function(name)
{ {
return this.attr(name) !== undefined; return this.attr(name) !== undefined;
@ -20,6 +21,9 @@ if ($.when.all === undefined)
} }
} }
//safety trigger
$(function() $(function()
{ {
$('.safety a').click(function(e) $('.safety a').click(function(e)
@ -44,7 +48,15 @@ $(function()
} }
}); });
}); });
});
//basic event listeners
$(function()
{
$('body').bind('dom-update', function()
{
function confirmEvent(e) function confirmEvent(e)
{ {
if (!confirm($(this).attr('data-confirm-text'))) if (!confirm($(this).attr('data-confirm-text')))
@ -103,6 +115,9 @@ $(function()
}); });
}); });
}); });
$('body').trigger('dom-update');
});
//modify DOM on small viewports //modify DOM on small viewports
@ -131,6 +146,7 @@ $(function()
}); });
//autocomplete //autocomplete
function split(val) function split(val)
{ {
@ -214,6 +230,9 @@ function getTagItOptions()
}; };
} }
//hotkeys
$(function() $(function()
{ {
Mousetrap.bind('q', function() { $('#top-nav input').focus(); return false; }, 'keyup'); Mousetrap.bind('q', function() { $('#top-nav input').focus(); return false; }, 'keyup');

View file

@ -1,4 +1,6 @@
$(function() $(function()
{
$('body').bind('dom-update', function()
{ {
$('.post a.toggle-tag').click(function(e) $('.post a.toggle-tag').click(function(e)
{ {
@ -32,3 +34,4 @@ $(function()
}); });
}); });
}); });
});

View file

@ -18,6 +18,7 @@ function scrolled()
var nextPage = dom.find('.paginator .next:not(.disabled) a').attr('href'); var nextPage = dom.find('.paginator .next:not(.disabled) a').attr('href');
$(document).data('page-next', nextPage); $(document).data('page-next', nextPage);
$('.paginator-content').append($(response).find('.paginator-content').children().css({opacity: 0}).animate({opacity: 1}, 'slow')); $('.paginator-content').append($(response).find('.paginator-content').children().css({opacity: 0}).animate({opacity: 1}, 'slow'));
$('body').trigger('dom-update');
scrolled(); scrolled();
}); });
} }