Skip to content

Commit

Permalink
replace selector for selecting selected rows
Browse files Browse the repository at this point in the history
muhaha
  • Loading branch information
martenson committed Oct 4, 2017
1 parent c3f7f39 commit a9c23f0
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 15 deletions.
Expand Up @@ -357,7 +357,7 @@ var FolderListView = Backbone.View.extend({
'</ol>',

// FOLDER CONTENT
'<table data-library-id="<%- parent_library_id %>" id="folder_table" class="grid table table-condensed">',
'<table data-library-id="<%- parent_library_id %>" class="grid table table-condensed">',
'<thead>',
'<th class="button_heading"></th>',
'<th style="text-align: center; width: 20px; " title="Check to select all datasets"><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>',
Expand Down
14 changes: 9 additions & 5 deletions client/galaxy/scripts/mvc/library/library-foldertoolbar-view.js
Expand Up @@ -207,8 +207,8 @@ var FolderToolbarView = Backbone.View.extend({

// show bulk import modal
modalBulkImport : function(){
var checkedValues = $('#folder_table').find(':checked');
if(checkedValues.length === 0){
var $checkedValues = this.findCheckedRows();
if($checkedValues.length === 0){
mod_toastr.info('You must select some datasets first.');
} else {
var that = this;
Expand Down Expand Up @@ -268,7 +268,7 @@ var FolderToolbarView = Backbone.View.extend({
processImportToHistory: function( history_id, history_name ){
var dataset_ids = [];
var folder_ids = [];
$('#folder_table').find(':checked').each(function(){
this.findCheckedRows().each(function(){
var row_id = $(this).closest('tr').data('id');
if (row_id.substring(0,1) == 'F'){
folder_ids.push(row_id);
Expand Down Expand Up @@ -323,7 +323,7 @@ var FolderToolbarView = Backbone.View.extend({
download : function( folder_id, format ){
var dataset_ids = [];
var folder_ids = [];
$( '#folder_table' ).find( ':checked' ).each( function(){
this.findCheckedRows().each( function(){
var row_id = $(this).closest('tr').data('id');
if (row_id.substring(0,1) == 'F'){
folder_ids.push(row_id);
Expand Down Expand Up @@ -997,7 +997,7 @@ var FolderToolbarView = Backbone.View.extend({
deleteSelectedItems: function(){
var dataset_ids = [];
var folder_ids = [];
var $checkedValues = $('#folder_table').find(':checked');
var $checkedValues = this.findCheckedRows();
if($checkedValues.length === 0){
mod_toastr.info('You must select at least one item for deletion.');
} else {
Expand Down Expand Up @@ -1116,6 +1116,10 @@ var FolderToolbarView = Backbone.View.extend({
}
},

findCheckedRows: function(){
return $('#folder_list_body').find(':checked');
},

templateToolBar: function(){
return _.template([
// container start
Expand Down
2 changes: 1 addition & 1 deletion static/maps/mvc/library/library-folderlist-view.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/maps/mvc/library/library-foldertoolbar-view.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/admin.bundled.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/analysis.bundled.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/scripts/bundled/libs.bundled.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/scripts/bundled/libs.bundled.js.map

Large diffs are not rendered by default.

0 comments on commit a9c23f0

Please sign in to comment.