mirror of
https://github.com/misterunknown/ifm.git
synced 2025-08-30 10:59:49 +02:00
added ability to change directory by typing the path in the input field in the navbar
This commit is contained in:
8
ifm.php
8
ifm.php
@@ -568,8 +568,10 @@ function IFM() {
|
||||
});
|
||||
};
|
||||
|
||||
this.changeDirectory = function( newdir, options={ absolute: false, pushState: true } ) {
|
||||
if( ! options.absolute ) newdir = self.pathCombine( self.currentDir, newdir );
|
||||
this.changeDirectory = function( newdir, options={} ) {
|
||||
config = { absolute: false, pushState: true };
|
||||
jQuery.extend( config, options );
|
||||
if( ! config.absolute ) newdir = self.pathCombine( self.currentDir, newdir );
|
||||
$.ajax({
|
||||
url: self.IFM_SCFN,
|
||||
type: "POST",
|
||||
@@ -582,7 +584,7 @@ function IFM() {
|
||||
self.currentDir = data.realpath;
|
||||
self.refreshFileTable();
|
||||
$( "#currentDir" ).val( self.currentDir );
|
||||
if( options.pushState ) history.pushState( { dir: self.currentDir }, self.currentDir, "#"+self.currentDir );
|
||||
if( config.pushState ) history.pushState( { dir: self.currentDir }, self.currentDir, "#"+self.currentDir );
|
||||
},
|
||||
error: function() { self.showMessage( "General error occured: No or broken response", "e" ); }
|
||||
});
|
||||
|
Reference in New Issue
Block a user