Merge pull request #186 from hargata/Hargata/parse.url
Hargata/parse.url
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
<input type="text" id="noteDescription" class="form-control" placeholder="Description of the note" value="@(isNew ? "" : Model.Description)">
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label for="noteTextArea">Notes</label>
|
||||
<label for="noteTextArea">Notes<a class="link-underline link-underline-opacity-0" onclick="showLinks(this)"><i class="bi bi-markdown ms-2"></i></a></label>
|
||||
<textarea class="form-control vehicleNoteContainer" id="noteTextArea">@Model.NoteText</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -416,22 +416,20 @@ function moveRecord(recordId, source, dest) {
|
||||
});
|
||||
}
|
||||
function showLinks(e) {
|
||||
$("#workAroundInput").show();
|
||||
var textAreaName = $(e.parentElement).attr("for");
|
||||
var text = $(`#${textAreaName}`).val();
|
||||
var textArea = $(`#${textAreaName}`);
|
||||
if ($(".markdown-overlay").length > 0) {
|
||||
$(".markdown-overlay").remove();
|
||||
return;
|
||||
}
|
||||
var text = textArea.val();
|
||||
if (text == undefined) {
|
||||
$("#workAroundInput").hide();
|
||||
return;
|
||||
}
|
||||
if (text.length > 0) {
|
||||
var formatted = markdown(text);
|
||||
Swal.fire({
|
||||
html: formatted,
|
||||
confirmButtonText: 'Close',
|
||||
}).then(() => {
|
||||
$("#workAroundInput").hide();
|
||||
});
|
||||
} else {
|
||||
$("#workAroundInput").hide();
|
||||
//var overlay div
|
||||
var overlayDiv = `<div class='markdown-overlay' style="position:absolute; top:${textArea.css('top')}; left:${textArea.css('left')}; width:${textArea.css('width')}; height:${textArea.css('height')}; padding:${textArea.css('padding')}; overflow-y:auto; background-color:var(--bs-modal-bg);">${formatted}</div>`;
|
||||
$(e.parentElement).append(overlayDiv);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user