How to disable touch?
Hello.Sometimes I need to disable focus on the textinpunt . How to make it? Best Regards
Have you tried placing a touchable view over the editor?
You can add your own methods in editor.html to support disabling/enabling editing:
zss_editor.disableContentEditing = function(html) {
$('#zss_editor_content').attr('contenteditable','false');
}
zss_editor.enableContentEditing = function(html) {
$('#zss_editor_content').attr('contenteditable','true');
}
Then in 'const.js':
disableContentEditing: 'DISABLE_CONTENT_EDITING',
enableContentEditing: 'ENABLE_CONTENT_EDITING',
Add the following to your WebviewMessageHandler.js:
case '${actions.disableContentEditing}':
zss_editor.disableContentEditing();
break;
case '${actions.enableContentEditing}':
zss_editor.enableContentEditing();
break;
Finally, add the methods in your 'RichTextEditor.js':
disableContentEditing() {
this._sendAction(actions.disableContentEditing);
}
enableContentEditing() {
this._sendAction(actions.enableContentEditing);
}
You can just call disableContentEditing and enableContentEditing to disable and re-enable touch
Can confirm this works. @ethanyuwang Thank you.
I modified the functions slightly for my particular use case so that title editing is controlled too, e.g.
zss_editor.disableContentEditing = function(html) {
$('#zss_editor_content').attr('contenteditable','false');
$('#zss_editor_title').attr('contenteditable','false');
}
zss_editor.enableContentEditing = function(html) {
$('#zss_editor_content').attr('contenteditable','true');
$('#zss_editor_title').attr('contenteditable','true');
}