mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-28 00:49:28 -05:00
webui: small main reorganisation
This commit is contained in:
parent
cdddab1f6a
commit
b2b96c097f
@ -17,7 +17,14 @@ function sendPassword(data) {
|
||||
});
|
||||
}
|
||||
|
||||
function Page(content, runst){
|
||||
function Page(menu){
|
||||
this.menu = menu;
|
||||
this.module = (menu.module != undefined) ? menu.module : menu.name;
|
||||
this.path = menu.path != undefined ? menu.path : ("/" + menu.name);
|
||||
|
||||
var runst = menu.runstate;
|
||||
var content = require(module);
|
||||
|
||||
this.view = function(){
|
||||
var runstate = rs("control/runstate");
|
||||
var needpasswd = rs("control/password");
|
||||
@ -85,10 +92,9 @@ module.exports = {
|
||||
|
||||
menudef.nodes.map(function(menu){
|
||||
if (menu.action === undefined) {
|
||||
var path = menu.path != undefined ? menu.path : ("/" + menu.name);
|
||||
var module = menu.module != undefined ? menu.module : menu.name
|
||||
console.log("adding route " + menu.name + " for " + path + " with module " + module);
|
||||
maps[path] = new Page(require(module), menu.runstate);
|
||||
var p = new Page(menu)
|
||||
console.log("adding route " + menu.name + " for " + p.path + " with module " + p.module);
|
||||
maps[p.path] = p;
|
||||
}
|
||||
});
|
||||
m.route.mode = "hash";
|
||||
|
@ -161,7 +161,8 @@ function checkFocus(){
|
||||
ctrl.focus();
|
||||
m.initControl = undefined;
|
||||
} else {
|
||||
console.log("focus-control '" + m.initControl + "' not found!")
|
||||
console.log("focus-control '" + m.initControl + "' not found!");
|
||||
m.initControl = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user