#1304 Scroll Down en boton others client left menu
gitea/salix/dev There was a failure building this commit
Details
gitea/salix/dev There was a failure building this commit
Details
This commit is contained in:
parent
ac5d9b909b
commit
132cfef4e9
|
@ -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'),
|
||||
|
|
Loading…
Reference in New Issue