mirror of
https://github.com/flarum/framework.git
synced 2025-02-22 02:39:56 +08:00
Fix up sorting of children in the tag selection list
This commit is contained in:
parent
c04e2e3db2
commit
d0f72fb05d
@ -99,6 +99,7 @@ export default class TagDiscussionModal extends FormModal {
|
|||||||
'data-index': tag.id(),
|
'data-index': tag.id(),
|
||||||
className: classList({
|
className: classList({
|
||||||
pinned: tag.position() !== null,
|
pinned: tag.position() !== null,
|
||||||
|
child: !!tag.parent(),
|
||||||
colored: !!tag.color(),
|
colored: !!tag.color(),
|
||||||
selected: selected.indexOf(tag) !== -1,
|
selected: selected.indexOf(tag) !== -1,
|
||||||
active: this.index() == tag
|
active: this.index() == tag
|
||||||
|
@ -15,9 +15,9 @@ export default function sortTags(tags) {
|
|||||||
} else if (aParent === bParent) {
|
} else if (aParent === bParent) {
|
||||||
return aPos - bPos;
|
return aPos - bPos;
|
||||||
} else if (aParent) {
|
} else if (aParent) {
|
||||||
return aParent.position() - bPos;
|
return aParent === b ? -1 : aParent.position() - bPos;
|
||||||
} else if (bParent) {
|
} else if (bParent) {
|
||||||
return aPos - bParent.position();
|
return bParent === a ? -1 : aPos - bParent.position();
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -168,7 +168,7 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
||||||
&.pinned {
|
&.pinned:not(.child) {
|
||||||
padding-top: 10px;
|
padding-top: 10px;
|
||||||
padding-bottom: 10px;
|
padding-bottom: 10px;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user