Files
galaxy/static/scripts/galaxy.tools.js
T
John Chilton d2ee7135a9 Outline galaxy.tools.js and load in tool_form.mako.
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.
2014-02-10 21:34:42 -06:00

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);
});
});