client/tag-input: move removal links to left
This commit is contained in:
parent
f035140c9f
commit
2ef63fcc7a
2 changed files with 41 additions and 38 deletions
|
@ -85,7 +85,7 @@ div.tag-input
|
||||||
font-size: 90%
|
font-size: 90%
|
||||||
unselectable()
|
unselectable()
|
||||||
|
|
||||||
ul.compact-tags
|
ul.compact-tags
|
||||||
width: 100%
|
width: 100%
|
||||||
margin-top: 0.5em
|
margin-top: 0.5em
|
||||||
li
|
li
|
||||||
|
@ -110,8 +110,13 @@ ul.compact-tags
|
||||||
color: $duplicate-tag-text-color
|
color: $duplicate-tag-text-color
|
||||||
i
|
i
|
||||||
padding-right: 0.4em
|
padding-right: 0.4em
|
||||||
.append
|
|
||||||
|
.tag-usages, .tag-weight, .remove-tag
|
||||||
color: $inactive-link-color
|
color: $inactive-link-color
|
||||||
margin-left: 0.7em
|
|
||||||
font-size: 90%
|
|
||||||
unselectable()
|
unselectable()
|
||||||
|
.tag-usages, .tag-weight
|
||||||
|
font-size: 90%
|
||||||
|
.tag-usages, .tag-weight
|
||||||
|
margin-left: 0.7em
|
||||||
|
.remove-tag
|
||||||
|
margin-right: 0.5em
|
||||||
|
|
|
@ -319,12 +319,12 @@ class TagInputControl extends events.EventTarget {
|
||||||
});
|
});
|
||||||
|
|
||||||
const usagesNode = document.createElement('span');
|
const usagesNode = document.createElement('span');
|
||||||
usagesNode.classList.add('append');
|
usagesNode.classList.add('tag-usages');
|
||||||
usagesNode.setAttribute(
|
usagesNode.setAttribute(
|
||||||
'data-pseudo-content', actualTag ? actualTag.usages : 0);
|
'data-pseudo-content', actualTag ? actualTag.usages : 0);
|
||||||
|
|
||||||
const removalLinkNode = document.createElement('a');
|
const removalLinkNode = document.createElement('a');
|
||||||
removalLinkNode.classList.add('append');
|
removalLinkNode.classList.add('remove-tag');
|
||||||
removalLinkNode.setAttribute('href', '');
|
removalLinkNode.setAttribute('href', '');
|
||||||
removalLinkNode.setAttribute('data-pseudo-content', '×');
|
removalLinkNode.setAttribute('data-pseudo-content', '×');
|
||||||
removalLinkNode.addEventListener('click', e => {
|
removalLinkNode.addEventListener('click', e => {
|
||||||
|
@ -334,10 +334,10 @@ class TagInputControl extends events.EventTarget {
|
||||||
|
|
||||||
const listItemNode = document.createElement('li');
|
const listItemNode = document.createElement('li');
|
||||||
listItemNode.setAttribute('data-tag', tagName);
|
listItemNode.setAttribute('data-tag', tagName);
|
||||||
|
listItemNode.appendChild(removalLinkNode);
|
||||||
listItemNode.appendChild(tagLinkNode);
|
listItemNode.appendChild(tagLinkNode);
|
||||||
listItemNode.appendChild(searchLinkNode);
|
listItemNode.appendChild(searchLinkNode);
|
||||||
listItemNode.appendChild(usagesNode);
|
listItemNode.appendChild(usagesNode);
|
||||||
listItemNode.appendChild(removalLinkNode);
|
|
||||||
return listItemNode;
|
return listItemNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,24 +402,22 @@ class TagInputControl extends events.EventTarget {
|
||||||
|
|
||||||
const weightNode = document.createElement('span');
|
const weightNode = document.createElement('span');
|
||||||
weightNode.classList.add('tag-weight');
|
weightNode.classList.add('tag-weight');
|
||||||
weightNode.classList.add('append');
|
|
||||||
weightNode.setAttribute('data-pseudo-content', weight);
|
weightNode.setAttribute('data-pseudo-content', weight);
|
||||||
|
|
||||||
const removeLinkNode = document.createElement('a');
|
const removalLinkNode = document.createElement('a');
|
||||||
removeLinkNode.classList.add('remove-tag');
|
removalLinkNode.classList.add('remove-tag');
|
||||||
removeLinkNode.classList.add('append');
|
removalLinkNode.setAttribute('href', '');
|
||||||
removeLinkNode.setAttribute('href', '');
|
removalLinkNode.setAttribute('data-pseudo-content', '×');
|
||||||
removeLinkNode.setAttribute('data-pseudo-content', '×');
|
removalLinkNode.addEventListener('click', e => {
|
||||||
removeLinkNode.addEventListener('click', e => {
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
listNode.removeChild(listItemNode);
|
listNode.removeChild(listItemNode);
|
||||||
this._suggestions.ban(tagName);
|
this._suggestions.ban(tagName);
|
||||||
});
|
});
|
||||||
|
|
||||||
const listItemNode = document.createElement('li');
|
const listItemNode = document.createElement('li');
|
||||||
|
listItemNode.appendChild(removalLinkNode);
|
||||||
listItemNode.appendChild(weightNode);
|
listItemNode.appendChild(weightNode);
|
||||||
listItemNode.appendChild(addLinkNode);
|
listItemNode.appendChild(addLinkNode);
|
||||||
listItemNode.appendChild(removeLinkNode);
|
|
||||||
listNode.appendChild(listItemNode);
|
listNode.appendChild(listItemNode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue