mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
Improved feature/unfeature choice in post context menu
refs https://github.com/TryGhost/Team/issues/2677
This commit is contained in:
parent
9eb886d26d
commit
2df049b079
1 changed files with 11 additions and 7 deletions
|
@ -164,18 +164,22 @@ export default class PostsContextMenu extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
get shouldFeatureSelection() {
|
get shouldFeatureSelection() {
|
||||||
const firstPost = this.selectionList.availableModels[0];
|
let featuredCount = 0;
|
||||||
if (!firstPost) {
|
for (const m of this.selectionList.availableModels) {
|
||||||
return true;
|
if (m.featured) {
|
||||||
|
featuredCount += 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return !firstPost.featured;
|
return featuredCount <= this.selectionList.availableModels.length / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
get canFeatureSelection() {
|
get canFeatureSelection() {
|
||||||
if (!this.selectionList.isSingle) {
|
for (const m of this.selectionList.availableModels) {
|
||||||
return true;
|
if (m.get('status') !== 'sent') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return this.selectionList.availableModels[0]?.get('status') !== 'sent';
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
get canUnpublishSelection() {
|
get canUnpublishSelection() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue