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') {
|
else if (definition.labelType === 'date') {
|
||||||
$input.prop("type", "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') {
|
else if (definition.labelType === 'url') {
|
||||||
$input.prop("placeholder", "http://website...");
|
$input.prop("placeholder", "http://website...");
|
||||||
|
|
||||||
const $openButton = $("<button>").addClass("btn btn-sm").text("Open").click(() => {
|
const $openButton = $("<span>")
|
||||||
window.open($input.val(), '_blank');
|
.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 {
|
else {
|
||||||
messagingService.logError("Unknown labelType=" + definitionAttr.labelType);
|
messagingService.logError("Unknown labelType=" + definitionAttr.labelType);
|
||||||
@ -229,7 +225,7 @@ async function createPromotedAttributeRow(definitionAttr, valueAttr) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const removeButton = $("<span>")
|
const removeButton = $("<span>")
|
||||||
.addClass("jam jam-trash pointer")
|
.addClass("jam jam-trash-alt pointer")
|
||||||
.prop("title", "Remove this attribute")
|
.prop("title", "Remove this attribute")
|
||||||
.click(async () => {
|
.click(async () => {
|
||||||
if (valueAttr.attributeId) {
|
if (valueAttr.attributeId) {
|
||||||
|
@ -467,6 +467,13 @@ html.theme-dark body {
|
|||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.open-external-link-button {
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 1.3em;
|
||||||
|
padding-left: 5px;
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
.go-to-selected-note-button {
|
.go-to-selected-note-button {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 1.3em;
|
font-size: 1.3em;
|
||||||
@ -585,7 +592,7 @@ table.promoted-attributes-in-tooltip td, table.promoted-attributes-in-tooltip th
|
|||||||
}
|
}
|
||||||
|
|
||||||
.multiplicity {
|
.multiplicity {
|
||||||
font-size: larger;
|
font-size: 1.3em;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this is because bootstrap (?) sets code color to red for some reason */
|
/* this is because bootstrap (?) sets code color to red for some reason */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user