diff --git a/view/js/main.js b/view/js/main.js index 4921ea94f..d1976fdaa 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -682,21 +682,26 @@ function dosubthread(ident) { liking = 1; } -function dostar(ident) { +function doStar(ident) { ident = ident.toString(); $('#like-rotator-' + ident).show(); - $.get('starred/' + ident, function(data) { - if (data.match(/1/)) { - $('#starred-' + ident).addClass('starred'); - $('#starred-' + ident).removeClass('unstarred'); + $.get('starred/' + ident) + .then(function(data) { + if (data.state === 1) { + $('#starred-' + ident) + .addClass('starred') + .removeClass('unstarred'); $('#star-' + ident).addClass('hidden'); $('#unstar-' + ident).removeClass('hidden'); } else { - $('#starred-' + ident).addClass('unstarred'); - $('#starred-' + ident).removeClass('starred'); + $('#starred-' + ident) + .addClass('unstarred') + .removeClass('starred'); $('#star-' + ident).removeClass('hidden'); $('#unstar-' + ident).addClass('hidden'); } + }) + .always(function () { $('#like-rotator-' + ident).hide(); }); } diff --git a/view/templates/wall_thread.tpl b/view/templates/wall_thread.tpl index 7dcdb15a5..0d2561869 100644 --- a/view/templates/wall_thread.tpl +++ b/view/templates/wall_thread.tpl @@ -105,7 +105,7 @@ {{/if}} {{if $item.star}} - + {{/if}} {{if $item.tagger}} diff --git a/view/theme/frio/templates/search_item.tpl b/view/theme/frio/templates/search_item.tpl index 6e76f23d6..bcd957396 100644 --- a/view/theme/frio/templates/search_item.tpl +++ b/view/theme/frio/templates/search_item.tpl @@ -206,8 +206,8 @@ {{if $item.star}}