UX: prevent anons from clearing pins in topic view
This commit is contained in:
parent
8c91d418dd
commit
826584b9c1
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue