mirror of
https://github.com/discourse/discourse.git
synced 2025-01-31 13:19:29 +08:00
FIX: Clicking on pin/unpin would refresh the page
This commit is contained in:
parent
0ce93f3b29
commit
07b8dc4eca
|
@ -6,22 +6,18 @@ export default Ember.Component.extend(StringBuffer, {
|
|||
hasDisplayableStatus: Em.computed.or('topic.archived','topic.closed', 'topic.pinned', 'topic.unpinned', 'topic.invisible', 'topic.archetypeObject.notDefault', 'topic.is_warning'),
|
||||
rerenderTriggers: ['topic.archived', 'topic.closed', 'topic.pinned', 'topic.visible', 'topic.unpinned', 'topic.is_warning'],
|
||||
|
||||
watchClick: function(){
|
||||
var self = this;
|
||||
click: function() {
|
||||
var topic = this.get('topic');
|
||||
|
||||
this.$('a').click(function(){
|
||||
var topic = self.get('topic');
|
||||
// only pin unpin for now
|
||||
if (topic.get('pinned')) {
|
||||
topic.clearPin();
|
||||
} else {
|
||||
topic.rePin();
|
||||
}
|
||||
|
||||
// only pin unpin for now
|
||||
if (topic.get('pinned')) {
|
||||
topic.clearPin();
|
||||
} else {
|
||||
topic.rePin();
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
}.on('didInsertElement'),
|
||||
return false;
|
||||
},
|
||||
|
||||
canAct: function() {
|
||||
return Discourse.User.current() && !this.get('disableActions');
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<div id='topic-title'>
|
||||
<div class='container'>
|
||||
{{#if showStarButton}}
|
||||
<a {{bind-attr class=":star starred:starred"}} {{action "toggleStar"}} href='#' {{bind-attr title="starTooltip"}}></a>
|
||||
<a {{bind-attr class=":star starred:starred"}} {{action "toggleStar"}} href {{bind-attr title="starTooltip"}}></a>
|
||||
{{/if}}
|
||||
|
||||
<div class="title-wrapper">
|
||||
|
@ -43,7 +43,7 @@
|
|||
{{/if}}
|
||||
|
||||
{{#if details.can_edit}}
|
||||
<a href='#' {{action "editTopic"}} class='edit-topic' title='{{i18n 'edit'}}'>{{fa-icon pencil}}</a>
|
||||
<a href {{action "editTopic"}} class='edit-topic' title='{{i18n 'edit'}}'>{{fa-icon pencil}}</a>
|
||||
{{/if}}
|
||||
</h1>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user