Ace editor blockScrolling 在哪里设置?
Where to set Ace editor blockScrolling?
当我使用 ace (with jquery-ace) 将文本区域更改为 ace-editor 时,它在控制台上显示此警告:
Automatically scrolling cursor into view after selection change
this will be disabled in the next version
set editor.$blockScrolling = Infinity to disable this message
在哪里设置 editor.$blockScrolling
变量以删除这些警告?
var aces = el.find('textarea.code.json');
var aceInit = function() {
//window.ace.$blockScrolling = Infinity; // no effect
//$.ace.$blockScrolling = Infinity; // no effect
//window.jQueryAce.AceDecorator.$blockScrolling = Infinity; // no effect
//window.jQueryAce.BaseEditor.$blockScrolling = Infinity; // no effect
//window.jQueryAce.TextAreaEditor.$blockScrolling = Infinity; // no effect
aces.ace({theme: 'eclipse', lang: 'json'}).each(function (idx, editor) {
var el = $(editor);
var editor = el.data('ace').editor;
//editor.$blockScrolling = Infinity; // no effect
var ace = editor.ace;
//ace.$blockScrolling = Infinity; // no effect, even this the correct one
ace.setReadOnly(el.prop('disabled'));
ace.setOption("maxLines", 10);
ace.setOption("minLines", 2);
});
}; // this function called when ace.js, mode-json.js and jquery-ace.js loaded
正确的是:
var el = $(the_element);
var editor = el.data('ace').editor;
editor.$blockScrolling = Infinity;
当我使用 ace (with jquery-ace) 将文本区域更改为 ace-editor 时,它在控制台上显示此警告:
Automatically scrolling cursor into view after selection change
this will be disabled in the next version
set editor.$blockScrolling = Infinity to disable this message
在哪里设置 editor.$blockScrolling
变量以删除这些警告?
var aces = el.find('textarea.code.json');
var aceInit = function() {
//window.ace.$blockScrolling = Infinity; // no effect
//$.ace.$blockScrolling = Infinity; // no effect
//window.jQueryAce.AceDecorator.$blockScrolling = Infinity; // no effect
//window.jQueryAce.BaseEditor.$blockScrolling = Infinity; // no effect
//window.jQueryAce.TextAreaEditor.$blockScrolling = Infinity; // no effect
aces.ace({theme: 'eclipse', lang: 'json'}).each(function (idx, editor) {
var el = $(editor);
var editor = el.data('ace').editor;
//editor.$blockScrolling = Infinity; // no effect
var ace = editor.ace;
//ace.$blockScrolling = Infinity; // no effect, even this the correct one
ace.setReadOnly(el.prop('disabled'));
ace.setOption("maxLines", 10);
ace.setOption("minLines", 2);
});
}; // this function called when ace.js, mode-json.js and jquery-ace.js loaded
正确的是:
var el = $(the_element);
var editor = el.data('ace').editor;
editor.$blockScrolling = Infinity;