目前我很难理解,Froala
单击工具栏按钮时哪种方式最好不要将焦点集中在编辑器上?
我试图通过事件访问编辑器,但我无法让它工作,我不确定这是正确的选择
new FroalaEditor(".froala_editor", {
events: {
'toolbar.focusEditor': function () {
alert("hello")
console.log(this);
}
}
});
我们有editor.button.bindCommands()
,但我也不明白。
我可以去工作的是
var editor = new FroalaEditor(".froala_editor", {}, function () {
$("button#moreText-1").click(function() {
editor.$el.blur()
});
});
现在,当我单击moreText按钮时,似乎现在没有焦点在编辑器上,插入符号也没有显示。
但是有没有更多的api类型的方法来做到这一点。例如,必须触发一个事件以将textarea聚焦在点击上,那么确保textarea没有获得焦点然后被模糊的最佳方法是什么。