mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
open external link button moved inside input
This commit is contained in:
parent
74acb08f7b
commit
24a0856d22
@ -171,22 +171,18 @@ async function createPromotedAttributeRow(definitionAttr, valueAttr) {
|
||||
}
|
||||
else if (definition.labelType === 'date') {
|
||||
$input.prop("type", "date");
|
||||
|
||||
const $todayButton = $("<button>").addClass("btn btn-sm").text("Today").click(() => {
|
||||
$input.val(utils.formatDateISO(new Date()));
|
||||
$input.trigger("change");
|
||||
});
|
||||
|
||||
$actionCell.append($todayButton);
|
||||
}
|
||||
else if (definition.labelType === 'url') {
|
||||
$input.prop("placeholder", "http://website...");
|
||||
|
||||
const $openButton = $("<button>").addClass("btn btn-sm").text("Open").click(() => {
|
||||
window.open($input.val(), '_blank');
|
||||
});
|
||||
const $openButton = $("<span>")
|
||||
.addClass("input-group-text open-external-link-button jam jam-arrow-up-right")
|
||||
.prop("title", "Open external link")
|
||||
.click(() => window.open($input.val(), '_blank'));
|
||||
|
||||
$actionCell.append($openButton);
|
||||
$input.after($("<div>")
|
||||
.addClass("input-group-append")
|
||||
.append($openButton));
|
||||
}
|
||||
else {
|
||||
messagingService.logError("Unknown labelType=" + definitionAttr.labelType);
|
||||
@ -229,7 +225,7 @@ async function createPromotedAttributeRow(definitionAttr, valueAttr) {
|
||||
});
|
||||
|
||||
const removeButton = $("<span>")
|
||||
.addClass("jam jam-trash pointer")
|
||||
.addClass("jam jam-trash-alt pointer")
|
||||
.prop("title", "Remove this attribute")
|
||||
.click(async () => {
|
||||
if (valueAttr.attributeId) {
|
||||
@ -239,7 +235,7 @@ async function createPromotedAttributeRow(definitionAttr, valueAttr) {
|
||||
$tr.remove();
|
||||
});
|
||||
|
||||
$multiplicityCell.append(addButton).append(" ").append(removeButton);
|
||||
$multiplicityCell.append(addButton).append(" ").append(removeButton);
|
||||
}
|
||||
|
||||
return $tr;
|
||||
|
@ -467,6 +467,13 @@ html.theme-dark body {
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.open-external-link-button {
|
||||
cursor: pointer;
|
||||
font-size: 1.3em;
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
}
|
||||
|
||||
.go-to-selected-note-button {
|
||||
cursor: pointer;
|
||||
font-size: 1.3em;
|
||||
@ -585,7 +592,7 @@ table.promoted-attributes-in-tooltip td, table.promoted-attributes-in-tooltip th
|
||||
}
|
||||
|
||||
.multiplicity {
|
||||
font-size: larger;
|
||||
font-size: 1.3em;
|
||||
}
|
||||
|
||||
/* this is because bootstrap (?) sets code color to red for some reason */
|
||||
|
Loading…
x
Reference in New Issue
Block a user