mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-22 05:15:29 +09:00
Relabel var_idx after reordering extra keys
This commit is contained in:
parent
4155f9fe9c
commit
e5ea2e5a6d
2 changed files with 9 additions and 2 deletions
|
|
@ -129,7 +129,7 @@
|
||||||
<td>
|
<td>
|
||||||
<div class="wrap" style="user-select:none">
|
<div class="wrap" style="user-select:none">
|
||||||
<button type="button" class="dragBtn">Move to</button>
|
<button type="button" class="dragBtn">Move to</button>
|
||||||
{$val->idx}
|
<span class="var_idx">{$val->idx}</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>{$val->eid}</td>
|
<td>{$val->eid}</td>
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,10 @@
|
||||||
|
|
||||||
// Reorder extra keys
|
// Reorder extra keys
|
||||||
$('table.extra_keys.sortable').on('after-drag.st', function(e) {
|
$('table.extra_keys.sortable').on('after-drag.st', function(e) {
|
||||||
|
const $table = $(this);
|
||||||
let order = [];
|
let order = [];
|
||||||
let i = 1;
|
let i = 1;
|
||||||
$(this).find('tbody > tr').each(function() {
|
$table.find('tbody > tr').each(function() {
|
||||||
order.push({
|
order.push({
|
||||||
eid: $(this).data('eid'),
|
eid: $(this).data('eid'),
|
||||||
old_idx: parseInt($(this).data('idx'), 10),
|
old_idx: parseInt($(this).data('idx'), 10),
|
||||||
|
|
@ -15,6 +16,12 @@
|
||||||
Rhymix.ajax('document.procDocumentAdminReorderExtraVars', {
|
Rhymix.ajax('document.procDocumentAdminReorderExtraVars', {
|
||||||
module_srl: $(this).data('moduleSrl'),
|
module_srl: $(this).data('moduleSrl'),
|
||||||
order: order
|
order: order
|
||||||
|
}, function() {
|
||||||
|
let i = 1;
|
||||||
|
$table.find('.var_idx').each(function() {
|
||||||
|
$(this).text(i);
|
||||||
|
i++;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue