Merge pull request #25325 from owncloud/filelist-prependslash
Filelist change dir auto-prepend slash
This commit is contained in:
commit
cf6fe95cbf
|
@ -513,7 +513,7 @@
|
|||
* Event handler for when the URL changed
|
||||
*/
|
||||
_onUrlChanged: function(e) {
|
||||
if (e && e.dir) {
|
||||
if (e && _.isString(e.dir)) {
|
||||
this.changeDirectory(e.dir, false, true);
|
||||
}
|
||||
},
|
||||
|
@ -1429,6 +1429,9 @@
|
|||
this.setPageTitle();
|
||||
}
|
||||
|
||||
if (targetDir.length > 0 && targetDir[0] !== '/') {
|
||||
targetDir = '/' + targetDir;
|
||||
}
|
||||
this._currentDirectory = targetDir;
|
||||
|
||||
// legacy stuff
|
||||
|
|
|
@ -1416,6 +1416,12 @@ describe('OCA.Files.FileList tests', function() {
|
|||
setDirSpy.restore();
|
||||
getFolderContentsStub.restore();
|
||||
});
|
||||
it('prepends a slash to directory if none was given', function() {
|
||||
fileList.changeDirectory('');
|
||||
expect(fileList.getCurrentDirectory()).toEqual('/');
|
||||
fileList.changeDirectory('noslash');
|
||||
expect(fileList.getCurrentDirectory()).toEqual('/noslash');
|
||||
});
|
||||
});
|
||||
describe('breadcrumb events', function() {
|
||||
var deferredList;
|
||||
|
|
Loading…
Reference in New Issue