Initial commit
This commit is contained in:
37
manager/src/frontend/js/app/ui/header/main.js
Normal file
37
manager/src/frontend/js/app/ui/header/main.js
Normal file
@ -0,0 +1,37 @@
|
||||
'use strict';
|
||||
|
||||
import Mn from 'backbone.marionette';
|
||||
|
||||
const template = require('./main.ejs');
|
||||
const Controller = require('../../controller');
|
||||
|
||||
module.exports = Mn.View.extend({
|
||||
template: template,
|
||||
|
||||
ui: {
|
||||
logo: '.navbar-brand',
|
||||
links: 'a[href^="#"]'
|
||||
},
|
||||
|
||||
events: {
|
||||
'click @ui.links': function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
let href = e.target.href.replace(/[^#]*#/g, '');
|
||||
|
||||
switch (href) {
|
||||
case 'dashboard':
|
||||
Controller.showDashboard();
|
||||
break;
|
||||
|
||||
case 'access':
|
||||
Controller.showAccess();
|
||||
break;
|
||||
|
||||
default:
|
||||
Controller.showDashboard();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user