This commit is contained in:
David Štaleker
2023-06-23 14:17:57 +02:00
parent d0fa4db3d8
commit 25e98d63ec
5 changed files with 61 additions and 32 deletions

View File

@@ -51,22 +51,37 @@
</div>
<div class="col-6">
<h4>Vezave</h4>
<table class="table card-table">
<thead>
<tr>
<th style="width: 30px;"></th>
<th>Veza</th>
</tr>
</thead>
<tbody id="tableBodyLinks">
<div class="row">
<div class="col-6">
<h5>Uvodno</h5>
<table class="table card-table">
<tbody id="tableBodyLinksPreText">
</tbody>
</table>
</div>
<div class="col-6">
<h5>Zaključno</h5>
<table class="table card-table">
<tbody id="tableBodyLinksPostText">
</tbody>
</table>
</div>
</div>
</tbody>
</table>
</div>
</div>
</div>
<div class="card-footer py-3 text-right">
<button id="savePrePostText" type="submit" class="btn btn-primary">Shrani nalog</button>
@if (Model.PrePostText.IdPrePostText > 0)
{
<button id="savePrePostText" type="submit" class="btn btn-primary">Shrani</button>
}
else
{
<button id="savePrePostText" type="submit" class="btn btn-primary">Dodaj</button>
}
<a asp-page="Index" class="btn btn-default">Prekliči</a>
</div>
</form>
@@ -124,7 +139,8 @@
success: function (data) {
$.unblockUI();
if (data.successful) {
$('#tableBodyLinks').html(data.tableLinks);
$('#tableBodyLinksPreText').html(data.tableLinksPreText);
$('#tableBodyLinksPostText').html(data.tableLinksPostText);
$('.chb-link').on('change',
function() {
toggleLink(this);
@@ -152,6 +168,7 @@
}
let row = $(checkbox).parent().parent();
let link = $(row).attr('data-link');
let type = $(row).attr('data-type');
let idPrePostTextLink = $(row).attr('data-idlink');
let idPrePostText = parseInt($('#inputIdPrePostText').val());
@@ -163,7 +180,7 @@
$('input:hidden[name="__RequestVerificationToken"]').val());
},
url: "AddEdit/?handler=LinkToggle",
data: { idPrePostText, link, idPrePostTextLink },
data: { idPrePostText, link, type, idPrePostTextLink },
success: function(data) {
$.unblockUI();
if (data.successful) {