mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Migrated the logic out of tool_form.mako that I could readily test, the rest of the custom javascript in tool_form.mako should likewise be migrated I assume. Holds a lot of logic downstream in my work related to running tools in parallel across many datasets and over dataset collections - https://github.com/jmchilton/galaxy-central/blob/collections_1/static/scripts/galaxy.tools.js.
21 lines
781 B
JavaScript
21 lines
781 B
JavaScript
// dependencies
|
|
define([ "mvc/tools" ], function( Tools ) {
|
|
|
|
var checkUncheckAll = function( name, check ) {
|
|
$("input[name='" + name + "'][type='checkbox']").attr('checked', !!check);
|
|
}
|
|
|
|
// Inserts the Select All / Unselect All buttons for checkboxes
|
|
$("div.checkUncheckAllPlaceholder").each( function() {
|
|
var check_name = $(this).attr("checkbox_name");
|
|
select_link = $("<a class='action-button'></a>").text("Select All").click(function() {
|
|
checkUncheckAll(check_name, true);
|
|
});
|
|
unselect_link = $("<a class='action-button'></a>").text("Unselect All").click(function() {
|
|
checkUncheckAll(check_name, false);
|
|
});
|
|
$(this).append(select_link).append(" ").append(unselect_link);
|
|
});
|
|
|
|
});
|