mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 17:35:34 +00:00
refactor(edit) mv focus to func
This commit is contained in:
parent
ae8ddf6d74
commit
1900656e7e
1 changed files with 7 additions and 6 deletions
|
|
@ -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');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue