refactor(edit) mv focus to func

This commit is contained in:
coderaiser 2013-07-09 13:03:48 +00:00
parent ae8ddf6d74
commit 1900656e7e

View file

@ -82,9 +82,7 @@ var CloudCmd, Util, DOM, ace;
if ( Util.isString(pValue) ) {
Ace.setValue(pValue);
CloudCmd.View.show(Element, function() {
Ace.focus();
});
CloudCmd.View.show(Element, focus);
Key.unsetBind();
}
else {
@ -96,9 +94,7 @@ var CloudCmd, Util, DOM, ace;
lValue = pData.data;
Ace.setValue(lValue);
CloudCmd.View.show(Element, function() {
Element.firstChild.focus();
});
CloudCmd.View.show(Element, focus);
}
});
}
@ -108,6 +104,11 @@ var CloudCmd, Util, DOM, ace;
CloudCmd.View.hide();
};
function focus() {
Ace.focus();
Ace.clearSelection();
Ace.moveCursorTo(0, 0);
}
function load(pCallBack){
Util.time(Name + ' load');