parent
9248240cf4
commit
27bce7ad2c
|
@ -95,16 +95,18 @@ export default {
|
||||||
return this.file.changed || this.file.tempFile || this.file.staged;
|
return this.file.changed || this.file.tempFile || this.file.staged;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
'file.active': function fileActiveWatch(active) {
|
||||||
|
if (this.file.type === 'blob' && active) {
|
||||||
|
this.scrollIntoView();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.hasPathAtCurrentRoute()) {
|
if (this.hasPathAtCurrentRoute()) {
|
||||||
this.scrollIntoView(true);
|
this.scrollIntoView(true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updated() {
|
|
||||||
if (this.file.type === 'blob' && this.file.active) {
|
|
||||||
this.scrollIntoView();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(['toggleTreeOpen']),
|
...mapActions(['toggleTreeOpen']),
|
||||||
clickFile() {
|
clickFile() {
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
title: Fixed IDE file row scrolling into view when hovering
|
||||||
|
merge_request:
|
||||||
|
author:
|
||||||
|
type: fixed
|
|
@ -121,4 +121,25 @@ describe('RepoFile', () => {
|
||||||
).toContain('Locked by testuser');
|
).toContain('Locked by testuser');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('calls scrollIntoView if made active', done => {
|
||||||
|
createComponent({
|
||||||
|
file: {
|
||||||
|
...file(),
|
||||||
|
type: 'blob',
|
||||||
|
active: false,
|
||||||
|
},
|
||||||
|
level: 0,
|
||||||
|
});
|
||||||
|
|
||||||
|
spyOn(vm, 'scrollIntoView');
|
||||||
|
|
||||||
|
vm.file.active = true;
|
||||||
|
|
||||||
|
vm.$nextTick(() => {
|
||||||
|
expect(vm.scrollIntoView).toHaveBeenCalled();
|
||||||
|
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue