From 4029ff1cc240318e2855c2cc7beaa89a6c93e161 Mon Sep 17 00:00:00 2001 From: Marco Dickert Date: Sat, 5 Aug 2017 03:05:25 +0200 Subject: [PATCH] reenable middle mouse click in file table --- build/libifm.php | 5 ++++- ifm.php | 5 ++++- src/ifm.js | 3 +++ src/templates/filetable.html | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/build/libifm.php b/build/libifm.php index 51d28ec..12ca75e 100644 --- a/build/libifm.php +++ b/build/libifm.php @@ -252,7 +252,7 @@ f00bar; {{#items}} - + {{linkname}} @@ -1132,6 +1132,8 @@ function IFM( params ) { item.download = {}; item.download.name = ( item.name == ".." ) ? "." : item.name; item.download.currentDir = self.currentDir; + if( self.config.isDocroot ) + item.href = 'href="'+self.hrefEncode( self.pathCombine( self.currentDir, item.name ) )+'"'; if( ! self.config.chmod ) item.readonly = "readonly"; if( self.config.edit || self.config.rename || self.config.delete || self.config.extract || self.config.copymove ) { @@ -1209,6 +1211,7 @@ function IFM( params ) { if( e.target.tagName == "TD" && e.target.parentElement.classList.contains( 'clickable-row' ) && e.target.parentElement.dataset.filename !== ".." && e.ctrlKey ) e.target.parentElement.classList.toggle( 'selectedItem' ); else if( e.target.classList.contains( 'ifmitem' ) ) { + console.log( "clicked" ); e.stopPropagation(); e.preventDefault(); if( e.target.dataset.type == "dir" ) diff --git a/ifm.php b/ifm.php index 54fbc05..a490205 100644 --- a/ifm.php +++ b/ifm.php @@ -252,7 +252,7 @@ f00bar; {{#items}} - + {{linkname}} @@ -1132,6 +1132,8 @@ function IFM( params ) { item.download = {}; item.download.name = ( item.name == ".." ) ? "." : item.name; item.download.currentDir = self.currentDir; + if( self.config.isDocroot ) + item.href = 'href="'+self.hrefEncode( self.pathCombine( self.currentDir, item.name ) )+'"'; if( ! self.config.chmod ) item.readonly = "readonly"; if( self.config.edit || self.config.rename || self.config.delete || self.config.extract || self.config.copymove ) { @@ -1209,6 +1211,7 @@ function IFM( params ) { if( e.target.tagName == "TD" && e.target.parentElement.classList.contains( 'clickable-row' ) && e.target.parentElement.dataset.filename !== ".." && e.ctrlKey ) e.target.parentElement.classList.toggle( 'selectedItem' ); else if( e.target.classList.contains( 'ifmitem' ) ) { + console.log( "clicked" ); e.stopPropagation(); e.preventDefault(); if( e.target.dataset.type == "dir" ) diff --git a/src/ifm.js b/src/ifm.js index f24fb58..e354d47 100644 --- a/src/ifm.js +++ b/src/ifm.js @@ -101,6 +101,8 @@ function IFM( params ) { item.download = {}; item.download.name = ( item.name == ".." ) ? "." : item.name; item.download.currentDir = self.currentDir; + if( self.config.isDocroot ) + item.href = 'href="'+self.hrefEncode( self.pathCombine( self.currentDir, item.name ) )+'"'; if( ! self.config.chmod ) item.readonly = "readonly"; if( self.config.edit || self.config.rename || self.config.delete || self.config.extract || self.config.copymove ) { @@ -178,6 +180,7 @@ function IFM( params ) { if( e.target.tagName == "TD" && e.target.parentElement.classList.contains( 'clickable-row' ) && e.target.parentElement.dataset.filename !== ".." && e.ctrlKey ) e.target.parentElement.classList.toggle( 'selectedItem' ); else if( e.target.classList.contains( 'ifmitem' ) ) { + console.log( "clicked" ); e.stopPropagation(); e.preventDefault(); if( e.target.dataset.type == "dir" ) diff --git a/src/templates/filetable.html b/src/templates/filetable.html index 40c49b4..9330f76 100644 --- a/src/templates/filetable.html +++ b/src/templates/filetable.html @@ -1,7 +1,7 @@ {{#items}} - + {{linkname}}