apply backslash fix to _setCurrentDir
This commit is contained in:
parent
b848062d88
commit
b7ff0d44d8
|
@ -1009,6 +1009,7 @@
|
|||
* @param changeUrl true to also update the URL, false otherwise (default)
|
||||
*/
|
||||
_setCurrentDir: function(targetDir, changeUrl) {
|
||||
targetDir = targetDir.replace(/\\/g, '/');
|
||||
var previousDir = this.getCurrentDirectory(),
|
||||
baseDir = OC.basename(targetDir);
|
||||
|
||||
|
|
|
@ -1242,6 +1242,10 @@ describe('OCA.Files.FileList tests', function() {
|
|||
expect(OC.parseQueryString(query)).toEqual({'dir': '/anothersubdir', sort: 'name', sortdirection: 'asc'});
|
||||
fakeServer.respond();
|
||||
});
|
||||
it('converts backslashes to slashes when calling changeDirectory()', function() {
|
||||
fileList.changeDirectory('/another\\subdir');
|
||||
expect(fileList.getCurrentDirectory()).toEqual('/another/subdir');
|
||||
});
|
||||
it('switches to root dir when current directory does not exist', function() {
|
||||
fakeServer.respondWith(/\/index\.php\/apps\/files\/ajax\/list.php\?dir=%2funexist/, [
|
||||
404, {
|
||||
|
|
Loading…
Reference in New Issue