[英]How to put cursor to the MathQuill (0.10) field so that one can type to edit right away?
[英]How to syncronize text field and formula field content in MathQuill 0.10?
所以,我想做的是獲取公式WYSIWYGish輸入元素
<span id="editable-math" class="mathquill-editable"></span>
和LaTeX輸入元素
<textarea id="mathjaxSrc" rows="6" cols="60"></textarea>
同步工作。 我的代碼是
var MQ = MathQuill.getInterface(2);
var mathField = MQ.MathField(latexMath, {
spaceBehavesLikeTab: true,
handlers: {
edit: function() {
latexSource.value = mathField.latex();
jQuery(latexSource).change();
}
}
});
jQuery(latexSource).change(function(){
mathField.latex(latexSource.value);
});
這通常可以正常工作:WYSIWYGish編輯器更新LaTeX輸入字段,但是LaTeX輸入字段僅在鼠標單擊其他位置(可能處於模糊狀態)后才更新WYSIWYGish編輯器。
我的問題是:如何在不單擊其他位置的情況下更新所見即所得編輯器的值? 我猜應該添加什么到.change
處理程序中?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.