javascript - Can't edit textarea in JQuery Terminal
问题描述
I am loading raw data from a url into JQuery Terminal...
var terminal = $('#term').terminal(function(command, term) {
term.pause();
//set url...
$.get(url, function(result) {
term.echo(result, {raw:true}).resume();
});
}
If the data contains a textarea, it is impossible to edit the text inside because as soon as I click on the textarea, the focus goes back to the prompt. Is there any way to fix this?
解决方案
您可以使用以下代码解决此问题:
term.on('mouseup', '.terminal-output textarea, .terminal-output input', function(e) {
term.disable();
return false;
});
jQuery Terminalfocus()
在 mouseup 中调用,它检测是否没有选择。
将其添加到下一个版本。
推荐阅读
- android - Android - 如何为随机数设置动画?
- bash - Bash sudo 脚本不提示输入密码 – Manjaro NFS 挂载
- c# - 具有三个公共属性的加法 3 个私有双数据成员的计算器
- python - 导入 Python 文件是否也会将导入的文件导入 shell?
- python - 在 pandas 中进行几乎不完整的数据透视表操作
- c++ - 从加密字符串程序获取输出时出现逻辑错误。
- python - mlxtend 中 StackingClassifier 函数中的元分类器是什么?
- mysql - 在 mysql 中使用 group_concate 按类别分隔显示调查结果
- python - 缩放数据的正确方法
- php - array_push 中的回显值