Merge pull request #15170 from owncloud/middleclickbreadcrumb
Fix middle click on breadcrumb
This commit is contained in:
commit
dac4436807
2 changed files with 4 additions and 4 deletions
|
@ -466,11 +466,11 @@
|
||||||
var $el = $(e.target).closest('.crumb'),
|
var $el = $(e.target).closest('.crumb'),
|
||||||
$targetDir = $el.data('dir');
|
$targetDir = $el.data('dir');
|
||||||
|
|
||||||
if ($targetDir !== undefined) {
|
if ($targetDir !== undefined && e.which === 1) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.changeDirectory($targetDir);
|
this.changeDirectory($targetDir);
|
||||||
|
this.updateSearch();
|
||||||
}
|
}
|
||||||
this.updateSearch();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1309,7 +1309,7 @@ describe('OCA.Files.FileList tests', function() {
|
||||||
fileList.changeDirectory('/subdir/two/three with space/four/five');
|
fileList.changeDirectory('/subdir/two/three with space/four/five');
|
||||||
fakeServer.respond();
|
fakeServer.respond();
|
||||||
var changeDirStub = sinon.stub(fileList, 'changeDirectory');
|
var changeDirStub = sinon.stub(fileList, 'changeDirectory');
|
||||||
fileList.breadcrumb.$el.find('.crumb:eq(0)').click();
|
fileList.breadcrumb.$el.find('.crumb:eq(0)').trigger({type: 'click', which: 1});
|
||||||
|
|
||||||
expect(changeDirStub.calledOnce).toEqual(true);
|
expect(changeDirStub.calledOnce).toEqual(true);
|
||||||
expect(changeDirStub.getCall(0).args[0]).toEqual('/');
|
expect(changeDirStub.getCall(0).args[0]).toEqual('/');
|
||||||
|
@ -1319,7 +1319,7 @@ describe('OCA.Files.FileList tests', function() {
|
||||||
fileList.changeDirectory('/subdir/two/three with space/four/five');
|
fileList.changeDirectory('/subdir/two/three with space/four/five');
|
||||||
fakeServer.respond();
|
fakeServer.respond();
|
||||||
var changeDirStub = sinon.stub(fileList, 'changeDirectory');
|
var changeDirStub = sinon.stub(fileList, 'changeDirectory');
|
||||||
fileList.breadcrumb.$el.find('.crumb:eq(3)').click();
|
fileList.breadcrumb.$el.find('.crumb:eq(3)').trigger({type: 'click', which: 1});
|
||||||
|
|
||||||
expect(changeDirStub.calledOnce).toEqual(true);
|
expect(changeDirStub.calledOnce).toEqual(true);
|
||||||
expect(changeDirStub.getCall(0).args[0]).toEqual('/subdir/two/three with space');
|
expect(changeDirStub.getCall(0).args[0]).toEqual('/subdir/two/three with space');
|
||||||
|
|
Loading…
Reference in a new issue