#768 salix.home
This commit is contained in:
parent
043454bab2
commit
5edd341127
|
@ -7,6 +7,11 @@
|
||||||
class="mdl-shadow--4dp">
|
class="mdl-shadow--4dp">
|
||||||
<vn-icon icon="{{::mod.icon}}"></vn-icon>
|
<vn-icon icon="{{::mod.icon}}"></vn-icon>
|
||||||
<h4 translate>{{::mod.name}}</h4>
|
<h4 translate>{{::mod.name}}</h4>
|
||||||
|
<span
|
||||||
|
ng-show='mod.keyBind'
|
||||||
|
vn-tooltip="Ctrl + Alt + {{mod.keyBind}}">
|
||||||
|
({{::mod.keyBind}})
|
||||||
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,15 +1,30 @@
|
||||||
import ngModule from '../../module';
|
import ngModule from '../../module';
|
||||||
import './style.scss';
|
import './style.scss';
|
||||||
|
import keybindings from '../../global-keybindings.yml';
|
||||||
|
|
||||||
export default class Home {
|
export default class Controller {
|
||||||
constructor(modulesFactory, $state) {
|
constructor(modulesFactory, $state, $translate, $scope) {
|
||||||
this.modules = modulesFactory.getModules();
|
this.modules = modulesFactory.getModules();
|
||||||
this.state = $state;
|
this.state = $state;
|
||||||
|
this.$translate = $translate;
|
||||||
|
this.$scope = $scope;
|
||||||
|
this.keybindings = keybindings;
|
||||||
|
}
|
||||||
|
$onInit() {
|
||||||
|
this.modules.map(module => {
|
||||||
|
let keyBind = this.keybindings.find(keyBind => {
|
||||||
|
return keyBind.sref == module.route.state;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (keyBind)
|
||||||
|
module.keyBind = keyBind.key.toUpperCase();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Home.$inject = ['modulesFactory', '$state'];
|
|
||||||
|
Controller.$inject = ['modulesFactory', '$state', '$translate', '$scope'];
|
||||||
|
|
||||||
ngModule.component('vnHome', {
|
ngModule.component('vnHome', {
|
||||||
template: require('./home.html'),
|
template: require('./home.html'),
|
||||||
controller: Home
|
controller: Controller
|
||||||
});
|
});
|
||||||
|
|
|
@ -33,6 +33,11 @@ vn-home {
|
||||||
& > vn-icon {
|
& > vn-icon {
|
||||||
font-size: 4em;
|
font-size: 4em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
& > span {
|
||||||
|
font-size: 0.9em;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
& > h4 {
|
& > h4 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding-top: .4em;
|
padding-top: .4em;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue