Always show your own edit button

This commit is contained in:
Robin Ward 2014-06-11 14:38:57 -04:00
parent b749585aa7
commit d40ec22bef

@ -102,13 +102,14 @@ export default Discourse.View.extend({
}
}
var yours = post.get('yours');
Discourse.SiteSettings.post_menu.split("|").forEach(function(i) {
var creator = self["buttonFor" + i.replace(/\+/, '').capitalize()];
if (creator) {
var button = creator.call(self, post);
if (button) {
allButtons.push(button);
if (hiddenButtons.indexOf(i) === -1) {
if ((yours && button.opts.alwaysShowYours) || (hiddenButtons.indexOf(i) === -1)) {
visibleButtons.push(button);
}
}
@ -201,7 +202,7 @@ export default Discourse.View.extend({
// Edit button
buttonForEdit: function(post) {
if (!post.get('can_edit')) return;
return new Button('edit', 'post.controls.edit', 'pencil');
return new Button('edit', 'post.controls.edit', 'pencil', {alwaysShowYours: true});
},
clickEdit: function(post) {