Fix up sorting of children in the tag selection list

This commit is contained in:
Toby Zerner 2015-06-19 18:19:13 +09:30
parent c04e2e3db2
commit d0f72fb05d
3 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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;

View File

@ -168,7 +168,7 @@
cursor: pointer;
white-space: nowrap;
&.pinned {
&.pinned:not(.child) {
padding-top: 10px;
padding-bottom: 10px;