mirror of
https://github.com/flarum/framework.git
synced 2025-06-20 17:21:21 +08:00
Update for discussion controls API
This commit is contained in:
4
extensions/sticky/js/bootstrap.js
vendored
4
extensions/sticky/js/bootstrap.js
vendored
@ -44,13 +44,13 @@ app.initializers.add('sticky', function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add a sticky control to discussions.
|
// Add a sticky control to discussions.
|
||||||
extend(Discussion.prototype, 'controls', function(items) {
|
extend(Discussion.prototype, 'moderationControls', function(items) {
|
||||||
if (this.canSticky()) {
|
if (this.canSticky()) {
|
||||||
items.add('sticky', ActionButton.component({
|
items.add('sticky', ActionButton.component({
|
||||||
label: this.isSticky() ? 'Unsticky' : 'Sticky',
|
label: this.isSticky() ? 'Unsticky' : 'Sticky',
|
||||||
icon: 'thumb-tack',
|
icon: 'thumb-tack',
|
||||||
onclick: toggleSticky.bind(this)
|
onclick: toggleSticky.bind(this)
|
||||||
}), {after: 'rename'});
|
}));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user