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

reenable middle mouse click in file table

This commit is contained in:
Marco Dickert
2017-08-05 03:05:25 +02:00
parent a480f8f8f2
commit 4029ff1cc2
4 changed files with 12 additions and 3 deletions

View File

@@ -252,7 +252,7 @@ f00bar;
{{#items}}
<tr class="clickable-row {{rowclasses}}" data-filename="{{name}}" data-eaction="{{eaction}}">
<td>
<a tabindex="0" id="{{guid}}" class="ifmitem" {{{tooltip}}} data-type="{{type}}">
<a {{{href}}} tabindex="0" id="{{guid}}" class="ifmitem" {{{tooltip}}} data-type="{{type}}">
<span class="{{icon}}"></span>
{{linkname}}
</a>
@@ -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" )

View File

@@ -252,7 +252,7 @@ f00bar;
{{#items}}
<tr class="clickable-row {{rowclasses}}" data-filename="{{name}}" data-eaction="{{eaction}}">
<td>
<a tabindex="0" id="{{guid}}" class="ifmitem" {{{tooltip}}} data-type="{{type}}">
<a {{{href}}} tabindex="0" id="{{guid}}" class="ifmitem" {{{tooltip}}} data-type="{{type}}">
<span class="{{icon}}"></span>
{{linkname}}
</a>
@@ -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" )

View File

@@ -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" )

View File

@@ -1,7 +1,7 @@
{{#items}}
<tr class="clickable-row {{rowclasses}}" data-filename="{{name}}" data-eaction="{{eaction}}">
<td>
<a tabindex="0" id="{{guid}}" class="ifmitem" {{{tooltip}}} data-type="{{type}}">
<a {{{href}}} tabindex="0" id="{{guid}}" class="ifmitem" {{{tooltip}}} data-type="{{type}}">
<span class="{{icon}}"></span>
{{linkname}}
</a>