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") {
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(" &nbsp; ").append(removeButton);
}
return $tr;
}

View file

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