[英]How to syncronize text field and formula field content in MathQuill 0.10?
[英]How to put cursor to the MathQuill (0.10) field so that one can type to edit right away?
我正在為 Etherpad 開發一個簡單的插件,以使用 MathQuill 編輯公式。 當工具欄打開時,我希望光標進入編輯字段。 該字段是 mathquillified 像這樣:
var MQ = MathQuill.getInterface(2);
var mathQuillEditor = MQ.MathField(mathQuillField, {
spaceBehavesLikeTab: true,
handlers: {
edit: function() {
latexEditor.value = mathQuillEditor.latex(); // update LaTeX field
jQuery(latexEditor).change(); // fire updating of CodeCogs
}
}
});
為了在編輯字段中獲取光標,我嘗試過:
mathQuillEditor.moveToRightEnd();
它在視覺上將光標放在那里,但沒有出現藍色邊距(表示編輯器處於活動狀態)並且打字沒有任何效果; 和
mathQuillEditor.el().focus();
這不會產生任何視覺差異。 我也嘗試將它們結合起來,但仍然沒有成功。 任何想法如何做到這一點?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.