Refactor batch view/edit pages to share some "execution options" logic
This commit is contained in:
parent
53950931af
commit
cdde848275
4 changed files with 67 additions and 43 deletions
44
tailbone/static/js/tailbone.batch.js
Normal file
44
tailbone/static/js/tailbone.batch.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
|
||||
/************************************************************
|
||||
*
|
||||
* tailbone.batch.js
|
||||
*
|
||||
* Common logic for view/edit batch pages
|
||||
*
|
||||
************************************************************/
|
||||
|
||||
|
||||
$(function() {
|
||||
|
||||
$('.newgrid-wrapper').gridwrapper();
|
||||
|
||||
$('#execute-batch').click(function() {
|
||||
if (has_execution_options) {
|
||||
$('#execution-options-dialog').dialog({
|
||||
title: "Execution Options",
|
||||
width: 500,
|
||||
height: 300,
|
||||
modal: true,
|
||||
buttons: [
|
||||
{
|
||||
text: "Execute",
|
||||
click: function(event) {
|
||||
$(event.target).button('option', 'label', "Executing, please wait...").button('disable');
|
||||
$('form[name="batch-execution"]').submit();
|
||||
}
|
||||
},
|
||||
{
|
||||
text: "Cancel",
|
||||
click: function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
} else {
|
||||
$(this).button('option', 'label', "Executing, please wait...").button('disable');
|
||||
$('form[name="batch-execution"]').submit();
|
||||
}
|
||||
});
|
||||
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue