1
0
mirror of https://github.com/misterunknown/ifm.git synced 2025-08-10 10:04:01 +02:00

multiselect: add ability to select rows with ctrl+click

This commit is contained in:
Marco Dickert
2017-02-16 16:20:05 +01:00
parent 89d5c0dc00
commit 40705815af
3 changed files with 10 additions and 4 deletions

View File

@@ -289,6 +289,7 @@ div#content { width: 100%; height: 350px; }
input[name=newperms] { width: 7em; }
#filetable tr th.buttons { min-width: 95px; }
#filetable tr.clickable-row.active td { background-color: lightblue; }
#navbar { max-width: 100%; }
@@ -483,7 +484,7 @@ function IFM() {
this.rebuildFileTable = function( data ) {
var newRows = $(document.createElement('tbody'));
for(i=0;i<data.length;i++) {
var newrow = "<tr>";
var newrow = '<tr class="clickable-row">';
var multisel = '';
if(self.config.multiselect == 1) {
multisel = '<input type="checkbox" ';
@@ -562,12 +563,12 @@ function IFM() {
if(self.config.multiselect == 1) {
$("input[name=multisel]").on("change", function(){ ifm.handleMultiSelect(); });
}
// todo: bootstrap-fancybox for images
$('a[data-toggle="tooltip"]').tooltip({
animated: 'fade',
placement: 'right',
html: true
});
$('.clickable-row').click(function(event) { if( event.ctrlKey ) $(this).toggleClass('active'); });
};
this.changeDirectory = function( newdir, options={ absolute: false, pushState: true } ) {

View File

@@ -56,7 +56,7 @@ function IFM() {
this.rebuildFileTable = function( data ) {
var newRows = $(document.createElement('tbody'));
for(i=0;i<data.length;i++) {
var newrow = "<tr>";
var newrow = '<tr class="clickable-row">';
var multisel = '';
if(self.config.multiselect == 1) {
multisel = '<input type="checkbox" ';
@@ -135,12 +135,16 @@ function IFM() {
if(self.config.multiselect == 1) {
$("input[name=multisel]").on("change", function(){ ifm.handleMultiSelect(); });
}
// todo: bootstrap-fancybox for images
$('a[data-toggle="tooltip"]').tooltip({
animated: 'fade',
placement: 'right',
html: true
});
$('.clickable-row').click(function(event) {
if( event.ctrlKey ) {
$(this).toggleClass('active');
}
});
};
this.changeDirectory = function( newdir, options={ absolute: false, pushState: true } ) {

View File

@@ -25,6 +25,7 @@ div#content { width: 100%; height: 350px; }
input[name=newperms] { width: 7em; }
#filetable tr th.buttons { min-width: 95px; }
#filetable tr.clickable-row.active td { background-color: lightblue; }
#navbar { max-width: 100%; }