Modify TinyMCE editor setup for mobile (#10)

pull/5742/merge
Aleksander Machniak 8 years ago
parent 6c4e86d816
commit 2b472f65cb

@ -206,6 +206,7 @@ function rcube_elastic_ui()
.addEventListener('message', message_displayed) .addEventListener('message', message_displayed)
.addEventListener('menu-open', menu_toggle) .addEventListener('menu-open', menu_toggle)
.addEventListener('menu-close', menu_toggle) .addEventListener('menu-close', menu_toggle)
.addEventListener('editor-init', tinymce_init)
.addEventListener('init', init); .addEventListener('init', init);
}; };
@ -295,6 +296,25 @@ function rcube_elastic_ui()
.addEventListener('afterlistsearch', list_handler); .addEventListener('afterlistsearch', list_handler);
}; };
/**
* Handler for editor-init event
*/
function tinymce_init(o)
{
// FIXME: only for mobile?
if (mode == 'phone') {
// Enable autoresize plugin
// TODO: autoresize for plain text editor area
o.config.plugins += ' autoresize';
// Make the toolbar icons bigger
o.config.toolbar_items_size = null;
// Use minimalistic toolbar
o.config.toolbar = 'undo redo | insert | styleselect';
}
};
/** /**
* Window resize handler * Window resize handler
* Does layout reflows e.g. on screen orientation change * Does layout reflows e.g. on screen orientation change

Loading…
Cancel
Save