mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-25 17:04:16 +00:00
fix(terminal) add rmKeys
This commit is contained in:
parent
d05da80b34
commit
288e70bd39
2 changed files with 19 additions and 5 deletions
|
|
@ -21,6 +21,11 @@ var CloudCmd, Util, DOM, CloudFunc, Terminal;
|
|||
Util.loadOnLoad([
|
||||
DOM.jqueryLoad,
|
||||
CloudCmd.View,
|
||||
/* rm view keys, it ruin terminal */
|
||||
function(callback) {
|
||||
CloudCmd.View.rmKeys(),
|
||||
Util.exec(callback);
|
||||
},
|
||||
load,
|
||||
CloudCmd.Socket,
|
||||
CloudTerm.show,
|
||||
|
|
@ -64,7 +69,7 @@ var CloudCmd, Util, DOM, CloudFunc, Terminal;
|
|||
}
|
||||
|
||||
CloudCmd.View.show(Element, function() {
|
||||
Term.element.focus();
|
||||
Element.focus();
|
||||
Terminal.brokenBold = true;
|
||||
|
||||
Util.exec(callback);
|
||||
|
|
@ -96,9 +101,10 @@ var CloudCmd, Util, DOM, CloudFunc, Terminal;
|
|||
});
|
||||
|
||||
Term.on('keydown', listener);
|
||||
|
||||
|
||||
Term.on('data', function(data) {
|
||||
socket.emit('terminal-data', data);
|
||||
if (data)
|
||||
socket.emit('terminal-data', data);
|
||||
});
|
||||
|
||||
//Term.resize(size.cols, size.rows);
|
||||
|
|
@ -118,7 +124,7 @@ var CloudCmd, Util, DOM, CloudFunc, Terminal;
|
|||
cols: cols,
|
||||
rows: rows
|
||||
};
|
||||
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
Key.unsetBind();
|
||||
},
|
||||
beforeClose : Key.setBind,
|
||||
|
||||
loop : false,
|
||||
openEffect : 'none',
|
||||
closeEffect : 'none',
|
||||
autoSize : false,
|
||||
|
|
@ -34,6 +34,14 @@ var CloudCmd, Util, DOM, CloudFunc, $;
|
|||
|
||||
View.show = show;
|
||||
View.hide = hide;
|
||||
View.rmKeys = rmKeys;
|
||||
|
||||
function rmKeys() {
|
||||
/* remove default key binding
|
||||
* which is ruin terminal
|
||||
*/
|
||||
$.fancybox.defaults.keys = null;
|
||||
}
|
||||
|
||||
function init() {
|
||||
var lFunc, lIsFunc, lIsCallBack;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue