Overview
I have just downloaded TinyMCE and added it to my website. I came across this when I noticed that a website I use on a day to day basis uses it, however their theming and layout is different and have a nice show/hide toggle as seen below.
As I am working on a website related to the website which uses this plugin, I have duplicated their styling and my version looks pretty much the same, I just wish to implement this feature.
TinyMCE Not Shown
TinyMCE Shown
My Current Code
/** My HTML **/
<textarea></textarea>
/** My Javascript **/
<script type="text/javascript" src="Assets/Plugins/tinymce/js/tinymce/tinymce.min.js"></script>
<script type="text/javascript">
tinymce.init({
selector: 'textarea',
height: "200",
theme: "modern",
plugins: [
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
'searchreplace wordcount visualblocks visualchars code fullscreen',
'insertdatetime media nonbreaking save table contextmenu directionality',
'emoticons template paste textcolor colorpicker textpattern imagetools codesample'
],
toolbar1: 'insertfile undo redo | bold italic | alignleft aligncenter alignright alignjustify | fullscreen | link image | bullist numlist outdent indent | emoticons | forecolor backcolor',
image_advtab: true,
templates: [{
title: 'Test template 1',
content: 'Test 1'
}, {
title: 'Test template 2',
content: 'Test 2'
}],
content_css: [
'//fonts.googleapis.com/css?family=Lato:300,300i,400,400i',
'//www.tinymce.com/css/codepen.min.css'
],
menu: {
file: {
title: 'File',
items: 'newdocument print'
},
edit: {
title: 'Edit',
items: 'undo redo | cut copy paste pastetext | selectall | replace'
},
insert: {
title: 'Insert',
items: ' media image link | charmap hr anchor pagebreak | insertdatetime nonbreaking template'
},
view: {
title: 'View',
items: 'visualaid visualchars visualblocks | preview fullscreen'
},
format: {
title: 'Format',
items: 'bold italic underline strikethrough superscript subscript | formats | removeformat'
},
table: {
title: 'Table',
items: 'inserttable tableprops deletetable | cell row column'
},
tools: {
title: 'Tools',
items: 'spellchecker code'
}
}
});
</script>
Questions
Upon clicking on the A button, the TinyMCE toolbar and bottom bar both slide at the same time to either show or hide. How would I be able to achieve this for my website --s this a built in feature?
Update - Got it working!
<script type="text/javascript">
$(document).ready(function(e) {
$('#TinyMCE_Toggle').click(function(e) {
$('.mce-menubar').slideToggle();
$('.mce-toolbar-grp').slideToggle();
$('.mce-statusbar').slideToggle();
});
})
</script>