nice icons for add / remove attribute

This commit is contained in:
azivner 2018-08-06 17:53:13 +02:00
parent fcf6141cde
commit c568ef2f8a
2 changed files with 13 additions and 5 deletions

View file

@ -297,7 +297,10 @@ async function loadAttributes() {
} }
if (definition.multiplicityType === "multivalue") { 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, { const $new = await createRow(definitionAttr, {
attributeId: "", attributeId: "",
type: valueAttr.type, type: valueAttr.type,
@ -308,9 +311,10 @@ async function loadAttributes() {
$tr.after($new); $tr.after($new);
}); });
$multiplicityCell.append(addButton); const removeButton = $("<span>")
.addClass("glyphicon glyphicon-trash pointer")
const removeButton = $("<button>").addClass("btn btn-small").text("Delete").click(async () => { .prop("title", "Remove this attribute")
.click(async () => {
if (valueAttr.attributeId) { if (valueAttr.attributeId) {
await server.remove("notes/" + noteId + "/attributes/" + valueAttr.attributeId); await server.remove("notes/" + noteId + "/attributes/" + valueAttr.attributeId);
} }
@ -318,7 +322,7 @@ async function loadAttributes() {
$tr.remove(); $tr.remove();
}); });
$multiplicityCell.append(removeButton); $multiplicityCell.append(addButton).append(" &nbsp; ").append(removeButton);
} }
return $tr; return $tr;
} }

View file

@ -433,4 +433,8 @@ html.theme-dark body {
#note-detail-promoted-attributes td, note-detail-promoted-attributes th { #note-detail-promoted-attributes td, note-detail-promoted-attributes th {
padding: 5px; padding: 5px;
}
.pointer {
cursor: pointer;
} }