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)
{
return this.attr(name) !== undefined;
@ -20,6 +21,9 @@ if ($.when.all === undefined)
}
}
//safety trigger
$(function()
{
$('.safety a').click(function(e)
@ -44,7 +48,15 @@ $(function()
}
});
});
});
//basic event listeners
$(function()
{
$('body').bind('dom-update', function()
{
function confirmEvent(e)
{
if (!confirm($(this).attr('data-confirm-text')))
@ -102,9 +114,12 @@ $(function()
form.append(input);
});
});
});
$('body').trigger('dom-update');
});
//modify DOM on small viewports
$(window).resize(function()
{
@ -131,6 +146,7 @@ $(function()
});
//autocomplete
function split(val)
{
@ -214,6 +230,9 @@ function getTagItOptions()
};
}
//hotkeys
$(function()
{
Mousetrap.bind('q', function() { $('#top-nav input').focus(); return false; }, 'keyup');

View file

@ -1,5 +1,7 @@
$(function()
{
$('body').bind('dom-update', function()
{
$('.post a.toggle-tag').click(function(e)
{
if(e.isPropagationStopped())
@ -31,4 +33,5 @@ $(function()
}
});
});
});
});

View file

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