refactor(client) route

This commit is contained in:
coderaiser 2014-05-22 05:47:58 -04:00
parent c6664ae7f2
commit 87aa17b6d7

View file

@ -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');