mirror of
https://github.com/zadam/trilium.git
synced 2025-02-24 06:54:44 +08:00
nice icons for add / remove attribute
This commit is contained in:
parent
fcf6141cde
commit
c568ef2f8a
2 changed files with 13 additions and 5 deletions
|
@ -297,7 +297,10 @@ async function loadAttributes() {
|
|||
}
|
||||
|
||||
if (definition.multiplicityType === "multivalue") {
|
||||
const addButton = $("<button>").addClass("btn btn-small").text("Add new").click(async () => {
|
||||
const addButton = $("<span>")
|
||||
.addClass("glyphicon glyphicon-plus pointer")
|
||||
.prop("title", "Add new attribute")
|
||||
.click(async () => {
|
||||
const $new = await createRow(definitionAttr, {
|
||||
attributeId: "",
|
||||
type: valueAttr.type,
|
||||
|
@ -308,9 +311,10 @@ async function loadAttributes() {
|
|||
$tr.after($new);
|
||||
});
|
||||
|
||||
$multiplicityCell.append(addButton);
|
||||
|
||||
const removeButton = $("<button>").addClass("btn btn-small").text("Delete").click(async () => {
|
||||
const removeButton = $("<span>")
|
||||
.addClass("glyphicon glyphicon-trash pointer")
|
||||
.prop("title", "Remove this attribute")
|
||||
.click(async () => {
|
||||
if (valueAttr.attributeId) {
|
||||
await server.remove("notes/" + noteId + "/attributes/" + valueAttr.attributeId);
|
||||
}
|
||||
|
@ -318,7 +322,7 @@ async function loadAttributes() {
|
|||
$tr.remove();
|
||||
});
|
||||
|
||||
$multiplicityCell.append(removeButton);
|
||||
$multiplicityCell.append(addButton).append(" ").append(removeButton);
|
||||
}
|
||||
return $tr;
|
||||
}
|
||||
|
|
|
@ -433,4 +433,8 @@ html.theme-dark body {
|
|||
|
||||
#note-detail-promoted-attributes td, note-detail-promoted-attributes th {
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.pointer {
|
||||
cursor: pointer;
|
||||
}
|
Loading…
Reference in a new issue