mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(client) route
This commit is contained in:
parent
c6664ae7f2
commit
87aa17b6d7
1 changed files with 8 additions and 6 deletions
|
|
@ -172,13 +172,15 @@ var Util, DOM, CloudFunc;
|
|||
|
||||
this.route = function(path) {
|
||||
var module, file, current, msg,
|
||||
query = path.split('/'),
|
||||
length = query.length;
|
||||
query = path.split('/');
|
||||
|
||||
if (length) {
|
||||
module = Util.getStrBigFirst(query[1]);
|
||||
file = query[2];
|
||||
current = DOM.getCurrentFileByName(file);
|
||||
if (path) {
|
||||
module = query[0];
|
||||
module = Util.slice(module, 1).join('');
|
||||
module = Util.getStrBigFirst(module);
|
||||
|
||||
file = query[1];
|
||||
current = DOM.getCurrentFileByName(file);
|
||||
|
||||
if (file && !current) {
|
||||
msg = CloudFunc.formatMsg('set current file', file, 'error');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue