feat: #8983, update pin tooltip in topic

This commit is contained in:
Barış Soner Uşaklı
2020-12-01 16:25:13 -05:00
parent 69864b8746
commit 954dc5b7be
3 changed files with 15 additions and 7 deletions

View File

@@ -311,10 +311,17 @@ define('forum/topic/threadTools', [
return;
}
components.get('topic/pin').toggleClass('hidden', data.isPinned).parent().attr('hidden', data.isPinned ? '' : null);
components.get('topic/unpin').toggleClass('hidden', !data.isPinned).parent().attr('hidden', !data.isPinned ? '' : null);
$('.topic-header [component="topic/pinned"]').toggleClass('hidden', !data.isPinned);
ajaxify.data.pinned = data.isPinned;
components.get('topic/pin').toggleClass('hidden', data.pinned).parent().attr('hidden', data.pinned ? '' : null);
components.get('topic/unpin').toggleClass('hidden', !data.pinned).parent().attr('hidden', !data.pinned ? '' : null);
var icon = $('.topic-header [component="topic/pinned"]');
icon.toggleClass('hidden', !data.pinned);
if (data.pinned) {
icon.translateAttr('title', data.pinExpiry && data.pinExpiryISO ?
'[[topic:pinned-with-expiry, ' + data.pinExpiryISO + ']]' :
'[[topic:pinned]]'
);
}
ajaxify.data.pinned = data.pinned;
};
function setFollowState(state) {