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

Merge pull request #57 from misterunknown/issue-54

closes #54
This commit is contained in:
Marco Dickert
2017-07-24 17:24:01 +02:00
committed by GitHub
3 changed files with 12 additions and 9 deletions

View File

@@ -966,7 +966,7 @@ function IFM( params ) {
self.currentDir = data.realpath;
self.refreshFileTable();
$( "#currentDir" ).val( self.currentDir );
if( config.pushState ) history.pushState( { dir: self.currentDir }, self.currentDir, "#"+self.currentDir );
if( config.pushState ) history.pushState( { dir: self.currentDir }, self.currentDir, "#"+encodeURIComponent( self.currentDir ) );
},
error: function() { self.showMessage( "General error occured: No or broken response", "e" ); }
});
@@ -1772,7 +1772,8 @@ function IFM( params ) {
*/
this.historyPopstateHandler = function(event) {
var dir = "";
if( event.state && event.state.dir ) dir = event.state.dir;
if( event.state && event.state.dir )
dir = event.state.dir;
self.changeDirectory( dir, { pushState: false, absolute: true } );
};
@@ -2048,7 +2049,7 @@ function IFM( params ) {
window.onpopstate = self.historyPopstateHandler;
// load initial file table
if( window.location.hash ) {
self.changeDirectory( window.location.hash.substring( 1 ) );
self.changeDirectory( decodeURIComponent( window.location.hash.substring( 1 ) ) );
} else {
this.refreshFileTable();
}

View File

@@ -966,7 +966,7 @@ function IFM( params ) {
self.currentDir = data.realpath;
self.refreshFileTable();
$( "#currentDir" ).val( self.currentDir );
if( config.pushState ) history.pushState( { dir: self.currentDir }, self.currentDir, "#"+self.currentDir );
if( config.pushState ) history.pushState( { dir: self.currentDir }, self.currentDir, "#"+encodeURIComponent( self.currentDir ) );
},
error: function() { self.showMessage( "General error occured: No or broken response", "e" ); }
});
@@ -1772,7 +1772,8 @@ function IFM( params ) {
*/
this.historyPopstateHandler = function(event) {
var dir = "";
if( event.state && event.state.dir ) dir = event.state.dir;
if( event.state && event.state.dir )
dir = event.state.dir;
self.changeDirectory( dir, { pushState: false, absolute: true } );
};
@@ -2048,7 +2049,7 @@ function IFM( params ) {
window.onpopstate = self.historyPopstateHandler;
// load initial file table
if( window.location.hash ) {
self.changeDirectory( window.location.hash.substring( 1 ) );
self.changeDirectory( decodeURIComponent( window.location.hash.substring( 1 ) ) );
} else {
this.refreshFileTable();
}

View File

@@ -228,7 +228,7 @@ function IFM( params ) {
self.currentDir = data.realpath;
self.refreshFileTable();
$( "#currentDir" ).val( self.currentDir );
if( config.pushState ) history.pushState( { dir: self.currentDir }, self.currentDir, "#"+self.currentDir );
if( config.pushState ) history.pushState( { dir: self.currentDir }, self.currentDir, "#"+encodeURIComponent( self.currentDir ) );
},
error: function() { self.showMessage( "General error occured: No or broken response", "e" ); }
});
@@ -1034,7 +1034,8 @@ function IFM( params ) {
*/
this.historyPopstateHandler = function(event) {
var dir = "";
if( event.state && event.state.dir ) dir = event.state.dir;
if( event.state && event.state.dir )
dir = event.state.dir;
self.changeDirectory( dir, { pushState: false, absolute: true } );
};
@@ -1310,7 +1311,7 @@ function IFM( params ) {
window.onpopstate = self.historyPopstateHandler;
// load initial file table
if( window.location.hash ) {
self.changeDirectory( window.location.hash.substring( 1 ) );
self.changeDirectory( decodeURIComponent( window.location.hash.substring( 1 ) ) );
} else {
this.refreshFileTable();
}