mirror of
https://github.com/flarum/core.git
synced 2025-07-24 18:21:33 +02:00
Add sticky permission
This commit is contained in:
3
extensions/sticky/js/bootstrap.js
vendored
3
extensions/sticky/js/bootstrap.js
vendored
@@ -19,6 +19,7 @@ app.initializers.add('sticky', function() {
|
||||
app.notificationComponentRegistry['discussionStickied'] = NotificationDiscussionStickied;
|
||||
|
||||
Discussion.prototype.isSticky = Model.prop('isSticky');
|
||||
Discussion.prototype.canSticky = Model.prop('canSticky');
|
||||
|
||||
// Add a sticky badge to discussions.
|
||||
extend(Discussion.prototype, 'badges', function(badges) {
|
||||
@@ -42,7 +43,7 @@ app.initializers.add('sticky', function() {
|
||||
|
||||
// Add a sticky control to discussions.
|
||||
extend(Discussion.prototype, 'controls', function(items) {
|
||||
if (this.canEdit()) {
|
||||
if (this.canSticky()) {
|
||||
items.add('sticky', ActionButton.component({
|
||||
label: this.isSticky() ? 'Unsticky' : 'Sticky',
|
||||
icon: 'thumb-tack',
|
||||
|
Reference in New Issue
Block a user