2
我试图在隐藏容器块时设置ace编辑器内容。如何在容器块隐藏时设置ace-editor内容?
我不能相同。
这里是我努力 http://jsfiddle.net/U5JtP/408/
这里是我的代码:
var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/javascript");
$('#hide').click(function(){
$('.panel-body').hide();
$('#hide').hide();
$('#Show').hide();
$('#setValue').show();
});
$('#Show').click(function(){
$('.panel-body').show();
$('#setValue').hide();
$('#Show').hide();
$('#hide').show();
});
$('#setValue').click(function(){
editor.getSession().setValue('function foo(items) {}');
$('.panel-body').hide();
$('#setValue').hide();
$('#Show').show();
$('#hide').hide();
});
////// -------------------------- Click on Hide -> SetValue -> Show
/// Why ace editor did not updated the content and how to update in such scenario?
你能不能使这项工作?
我确实考虑你的答案,但我正在寻求更好的答案。这将在ace中进行一些内部配置。我不想手动调用'updateFull'。 – codeofnode