mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 04:31:57 +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(),
|
||||
className: classList({
|
||||
pinned: tag.position() !== null,
|
||||
child: !!tag.parent(),
|
||||
colored: !!tag.color(),
|
||||
selected: selected.indexOf(tag) !== -1,
|
||||
active: this.index() == tag
|
||||
|
@ -15,9 +15,9 @@ export default function sortTags(tags) {
|
||||
} else if (aParent === bParent) {
|
||||
return aPos - bPos;
|
||||
} else if (aParent) {
|
||||
return aParent.position() - bPos;
|
||||
return aParent === b ? -1 : aParent.position() - bPos;
|
||||
} else if (bParent) {
|
||||
return aPos - bParent.position();
|
||||
return bParent === a ? -1 : aPos - bParent.position();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -168,7 +168,7 @@
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
|
||||
&.pinned {
|
||||
&.pinned:not(.child) {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user