I have multiple editors with one toolbar. Initially I have just one editor and add say second and third based on the click of a button in the toolbar. The toolbar is on the top of the 1st editor and the subsequent editors that gets added are stacked one below the other.
The problems I have are:
How do I show the toolbar when any of the editor is in focus?
How do I move the toolbar on top of the editor in focus?
To fix problem 1, add some custom CSS Like this:
.ta-toolbar{
display: none;
}
.ta-toolbar.focussed{
display: block;
}
The focussed class is added to the toolbar when any of it's linked editors are focussed into.
To fix problem 2 is probably a little more tricky and will require some extra work. The steps are:
focussed class (use absolute positioning probably).If someone needs an example for a simpler scenario. To put the toolbar somewhere else one can use something like:
<div text-angular-toolbar class="toolbar" name="toolbar" ta-toolbar="[['h1', 'h2', 'p', 'pre', 'quote', 'bold', 'italics', 'underline', 'ul', 'ol', 'justifyLeft', 'justifyCenter', 'justifyRight', 'indent', 'outdent', 'insertImage']]"></div>
<div style="overflow: auto; width: 100%; height: 100%; max-width: 700px; max-height: 750px; background-color: #FFFFFF;">
<div text-angular ta-target-toolbars="toolbar" ng-model="htmlContent"></div>
</div>
Perhaps for someone this comes in handy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With