v1.18.x
psychobunny 10 years ago
parent 7a2ccf6031
commit a6481aefe3

@ -2,8 +2,8 @@
/*global define, socket, app, admin, utils, bootbox, RELATIVE_PATH*/ /*global define, socket, app, admin, utils, bootbox, RELATIVE_PATH*/
define('forum/admin/manage/tags', ['forum/infinitescroll', 'admin/selectable'], function(infinitescroll, selectable) { define('forum/admin/manage/tags', ['forum/infinitescroll', 'admin/selectable'], function(infinitescroll, selectable) {
var Tags = {}; var Tags = {},
var timeoutId = 0; timeoutId = 0;
Tags.init = function() { Tags.init = function() {
handleColorPickers(); handleColorPickers();
@ -14,11 +14,13 @@ define('forum/admin/manage/tags', ['forum/infinitescroll', 'admin/selectable'],
clearTimeout(timeoutId); clearTimeout(timeoutId);
timeoutId = 0; timeoutId = 0;
} }
timeoutId = setTimeout(function() { timeoutId = setTimeout(function() {
socket.emit('topics.searchAndLoadTags', {query: $('#tag-search').val()}, function(err, tags) { socket.emit('topics.searchAndLoadTags', {query: $('#tag-search').val()}, function(err, tags) {
if (err) { if (err) {
return app.alertError(err.message); return app.alertError(err.message);
} }
infinitescroll.parseAndTranslate('admin/manage/tags', 'tags', {tags: tags}, function(html) { infinitescroll.parseAndTranslate('admin/manage/tags', 'tags', {tags: tags}, function(html) {
$('.tag-list').html(html); $('.tag-list').html(html);
utils.makeNumbersHumanReadable(html.find('.human-readable-number')); utils.makeNumbersHumanReadable(html.find('.human-readable-number'));
@ -85,7 +87,6 @@ define('forum/admin/manage/tags', ['forum/infinitescroll', 'admin/selectable'],
}); });
} }
$('[data-name="bgColor"], [data-name="color"]').each(enableColorPicker); $('[data-name="bgColor"], [data-name="color"]').each(enableColorPicker);
} }
@ -100,6 +101,7 @@ define('forum/admin/manage/tags', ['forum/infinitescroll', 'admin/selectable'],
if (err) { if (err) {
return app.alertError(err.message); return app.alertError(err.message);
} }
app.alertSuccess('Tag Updated!'); app.alertSuccess('Tag Updated!');
}); });
} }

Loading…
Cancel
Save