refactor(edit) show: add isDir

This commit is contained in:
coderaiser 2013-11-29 09:05:20 +00:00
parent 0d3064c406
commit 0419225c5f

View file

@ -43,6 +43,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch;
this.show = function(pValue) {
var lMode,
lName = DOM.getCurrentName(),
isDir = DOM.isCurrentIsDir(),
lExt = Util.getExtension(lName);
if (!Loading) {
@ -65,7 +66,7 @@ var CloudCmd, Util, DOM, CloudFunc, ace, DiffProto, diff_match_patch;
if (!Modelist)
Modelist = ace.require('ace/ext/modelist');
if (DOM.isCurrentIsDir())
if (isDir)
lMode = Modelist.modesByName.json.mode
else
lMode = Modelist.getModeForPath(lName).mode;