less is more

v1.18.x
Baris Soner Usakli 11 years ago
parent 2088903358
commit 122d1ad82a

@ -1006,36 +1006,19 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
} }
function set_pinned_state(pinned, alert) { function set_pinned_state(pinned, alert) {
var pinEl = $('.pin_thread');
translator.translate('<i class="fa fa-fw fa-thumb-tack"></i> [[topic:thread_tools.' + (pinned ? 'unpin' : 'pin') + ']]', function(translated) { translator.translate('<i class="fa fa-fw fa-thumb-tack"></i> [[topic:thread_tools.' + (pinned ? 'unpin' : 'pin') + ']]', function(translated) {
if (pinned) { $('.pin_thread').html(translated);
pinEl.html(translated);
if (alert) {
app.alert({
'alert_id': 'thread_pin',
type: 'success',
title: 'Thread Pinned',
message: 'Thread has been successfully pinned',
timeout: 5000
});
}
thread_state.pinned = '1';
} else {
pinEl.html(translated);
if (alert) { if (alert) {
app.alert({ app.alert({
'alert_id': 'thread_pin', 'alert_id': 'thread_pin',
type: 'success', type: 'success',
title: 'Thread Unpinned', title: 'Thread ' + (pinned ? 'Pinned' : 'Unpinned'),
message: 'Thread has been successfully unpinned', message: 'Thread has been successfully ' + (pinned ? 'pinned' : 'unpinned'),
timeout: 5000 timeout: 5000
}); });
} }
thread_state.pinned = pinned ? '1' : '0';
thread_state.pinned = '0';
}
}); });
} }

Loading…
Cancel
Save