Commit 46ff34e2 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

use handler to avoid multiple ajax queries

parent a7a46624
...@@ -204,24 +204,25 @@ ...@@ -204,24 +204,25 @@
$('#setAndRunModalBody').wfform('run'); $('#setAndRunModalBody').wfform('run');
$('#back_workflow').hide(); $('#back_workflow').hide();
$('.status-panel').show(); $('.status-panel').show();
}); });
function outputWFHandler(event) {
$('#statusModalBody').wfoutputs({
workflowID: event.data.workflow_id
})
$('#back_workflow').show();
$('.status-panel').hide();
}
$("#active-workflows-list").activewf(); $("#active-workflows-list").activewf();
$("#active-workflows-list").on("select.active", function(event, workflow) { $("#active-workflows-list").on("select.active", function(event, workflow) {
$('#statusModalLabel').html(workflow["name"] + " <small>" + workflow["id"] + "</small>"); $('#statusModalLabel').html(workflow["name"] + " <small>" + workflow["id"] + "</small>");
$('#statusModalBody').wfstatus({ $('#statusModalBody').wfstatus({
workflowID: workflow["id"] workflowID: workflow.id
}); });
$('#statusModal').modal(); $('#statusModal').modal();
$('#back_workflow').hide(); $('#back_workflow').hide();
$('.status-panel').show(); $('.status-panel').show();
$("#output_workflow").click(function() { $("#output_workflow").unbind('click', outputWFHandler);
$('#statusModalBody').wfoutputs({ $("#output_workflow").bind('click', {"workflow_id": workflow.id}, outputWFHandler);
workflowID: workflow.id
})
$('#back_workflow').show();
$('.status-panel').hide();
});
}); });
/** /**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment