UX: prevent anons from clearing pins in topic view

This commit is contained in:
Régis Hanol 2018-01-31 20:34:53 +01:00
parent 8c91d418dd
commit 826584b9c1
1 changed files with 3 additions and 8 deletions

View File

@ -8,15 +8,10 @@ export default Ember.Component.extend(bufferedRender({
rerenderTriggers: ['topic.archived', 'topic.closed', 'topic.pinned', 'topic.visible', 'topic.unpinned', 'topic.is_warning'], rerenderTriggers: ['topic.archived', 'topic.closed', 'topic.pinned', 'topic.visible', 'topic.unpinned', 'topic.is_warning'],
click(e) { click(e) {
if ($(e.target).hasClass('d-icon-thumb-tack')) { // only pin unpin for now
if (this.get("canAct") && $(e.target).hasClass('d-icon-thumb-tack')) {
const topic = this.get('topic'); const topic = this.get('topic');
topic.get('pinned') ? topic.clearPin() : topic.rePin();
// only pin unpin for now
if (topic.get('pinned')) {
topic.clearPin();
} else {
topic.rePin();
}
} }
return false; return false;