Compare commits
3 Commits
dev
...
6082-refac
Author | SHA1 | Date |
---|---|---|
Carlos Satorres | 7c377fb5c5 | |
Carlos Satorres | c2d70fb367 | |
Carlos Satorres | f2d761df85 |
|
@ -58,6 +58,14 @@
|
||||||
Home
|
Home
|
||||||
</vn-item-section>
|
</vn-item-section>
|
||||||
</a>
|
</a>
|
||||||
|
<a class="vn-item" onclick="redirect(route)">
|
||||||
|
<vn-item-section avatar>
|
||||||
|
<vn-icon icon="move_up"></vn-icon>
|
||||||
|
</vn-item-section>
|
||||||
|
<vn-item-section translate>
|
||||||
|
Lilium
|
||||||
|
</vn-item-section>
|
||||||
|
</a>
|
||||||
<a class="vn-item"
|
<a class="vn-item"
|
||||||
ng-repeat="mod in ::$ctrl.modules"
|
ng-repeat="mod in ::$ctrl.modules"
|
||||||
ui-sref="{{::mod.route.state}}">
|
ui-sref="{{::mod.route.state}}">
|
||||||
|
|
|
@ -31,6 +31,26 @@ export class Layout extends Component {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async redirect(route) {
|
||||||
|
if (route.path === '/dashboard') {
|
||||||
|
const url = await getUrl('');
|
||||||
|
window.location.href = url;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let section = route.path.substring(1);
|
||||||
|
section = section.substring(0, section.indexOf('/'));
|
||||||
|
|
||||||
|
if (route.params && route.params.id) {
|
||||||
|
const url = await getUrl(`${section}/${route.params.id}/summary`);
|
||||||
|
window.location.href = url;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const url = await getUrl(section + '/index');
|
||||||
|
window.location.href = url;
|
||||||
|
}
|
||||||
|
|
||||||
$onDestroy() {
|
$onDestroy() {
|
||||||
this.vnToken.stopRenewer();
|
this.vnToken.stopRenewer();
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
ng-class="{shown: $ctrl.shown}"
|
ng-class="{shown: $ctrl.shown}"
|
||||||
ng-click="$ctrl.hide()">
|
ng-click="$ctrl.hide()">
|
||||||
</vn-background>
|
</vn-background>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="menu"
|
class="menu"
|
||||||
ng-class="{shown: $ctrl.shown}"
|
ng-class="{shown: $ctrl.shown}"
|
||||||
|
|
|
@ -57,6 +57,15 @@ export default class SideMenu extends Component {
|
||||||
else this.show();
|
else this.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async redirect() {
|
||||||
|
let section = route.path.substring(1);
|
||||||
|
if (!route.path.includes('/')) return (window.location.href = await getUrl(section));
|
||||||
|
section = section.substring(0, section.indexOf('/'));
|
||||||
|
if (route?.params?.id)
|
||||||
|
window.location.href = await getUrl(`${section}/${route.params.id}/summary`);
|
||||||
|
else
|
||||||
|
window.location.href = await getUrl(section + 'index');
|
||||||
|
}
|
||||||
show() {
|
show() {
|
||||||
if (this.shown) return;
|
if (this.shown) return;
|
||||||
this.shown = true;
|
this.shown = true;
|
||||||
|
|
|
@ -1,2 +1,6 @@
|
||||||
<header ng-transclude>
|
<header ng-transclude>
|
||||||
</header>
|
<button
|
||||||
|
icon="more_up"
|
||||||
|
onclick="redirect()" >
|
||||||
|
</button>
|
||||||
|
</header>
|
||||||
|
|
Loading…
Reference in New Issue