Admin: add Describe button to edit form (restore describe->use in form)
This commit is contained in:
parent
53ad9199c9
commit
96d14d8563
1 changed files with 31 additions and 17 deletions
18
new.php
18
new.php
|
|
@ -852,9 +852,23 @@ function applySwitchPayload(payload){
|
||||||
if (first) actions.insertBefore(describe, first);
|
if (first) actions.insertBefore(describe, first);
|
||||||
else actions.appendChild(describe);
|
else actions.appendChild(describe);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
function showModal(job, description, rawJson){
|
// Also add a Describe button to the edit form (when editing a single job)
|
||||||
|
var editForm = document.getElementById('edit-form');
|
||||||
|
if (editForm && !editForm.querySelector('.describe-button')) {
|
||||||
|
var dirInput = editForm.querySelector('input[name="dir"]');
|
||||||
|
if (dirInput && dirInput.value) {
|
||||||
|
var describe2 = document.createElement('button');
|
||||||
|
describe2.className = 'button describe-button';
|
||||||
|
describe2.type = 'button';
|
||||||
|
describe2.dataset.job = dirInput.value;
|
||||||
|
describe2.textContent = 'Describe';
|
||||||
|
var submit = editForm.querySelector('button[type="submit"]');
|
||||||
|
if (submit) submit.parentNode.insertBefore(describe2, submit);
|
||||||
|
else editForm.appendChild(describe2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function showModal(job, description, rawJson){
|
||||||
var existing = document.getElementById('mvlog-gemini-modal');
|
var existing = document.getElementById('mvlog-gemini-modal');
|
||||||
if (existing) existing.remove();
|
if (existing) existing.remove();
|
||||||
var overlay = document.createElement('div');
|
var overlay = document.createElement('div');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue