added new label type URL with open button, fixes #156

This commit is contained in:
azivner 2018-08-18 15:00:52 +02:00
parent 0aa08b1c1e
commit 44f85224e7
2 changed files with 11 additions and 1 deletions

View File

@ -27,7 +27,8 @@ function AttributesModel() {
{ text: "Text", value: "text" },
{ text: "Number", value: "number" },
{ text: "Boolean", value: "boolean" },
{ text: "Date", value: "date" }
{ text: "Date", value: "date" },
{ text: "URL", value: "url"}
];
this.multiplicityTypes = [

View File

@ -309,6 +309,15 @@ async function loadAttributes() {
$actionCell.append($todayButton);
}
else if (definition.labelType === 'url') {
$input.prop("placeholder", "http://website...");
const $openButton = $("<button>").addClass("btn btn-small").text("Open").click(() => {
window.open($input.val(), '_blank');
});
$actionCell.append($openButton);
}
else {
messagingService.logError("Unknown labelType=" + definitionAttr.labelType);
}