#1304 Scroll Down en boton others client left menu
gitea/salix/dev There was a failure building this commit Details

This commit is contained in:
Carlos Jimenez Ruiz 2019-10-02 12:56:19 +02:00
parent ac5d9b909b
commit 132cfef4e9
1 changed files with 10 additions and 2 deletions

View File

@ -2,7 +2,9 @@ import ngModule from '../../module';
import './style.scss';
export default class LeftMenu {
constructor($state, $transitions, aclService) {
constructor($state, $transitions, aclService, $timeout, $element) {
this.$element = $element;
this.$timeout = $timeout;
this.$state = $state;
this.deregisterCallback = $transitions.onSuccess({},
() => this.activateItem());
@ -89,13 +91,19 @@ export default class LeftMenu {
setActive(item) {
if (item.state) return;
item.active = !item.active;
this.$timeout(() => {
let element = this.$element[0].querySelector('a[class="expanded"]');
if (element)
element.scrollIntoView();
});
}
$onDestroy() {
this.deregisterCallback();
}
}
LeftMenu.$inject = ['$state', '$transitions', 'aclService'];
LeftMenu.$inject = ['$state', '$transitions', 'aclService', '$timeout', '$element'];
ngModule.component('vnLeftMenu', {
template: require('./left-menu.html'),