Remove status bar and keep resize icon in tinymce 4 - tinymce

I am trying to remove the status bar and keep the resize icon in tinymce just like a normal text area resizer. Any idea ?

elementpath
This option allows you to disable the element path within the status bar at the bottom of the editor.
Type:
Boolean
Default Value:
true
Possible Values:
true, false
Example
tinymce.init({
selector:'textarea',// change this value according to your HTML
elementpath:false
});

TinyMCE does not support what you are trying to do via configuration. The resize handle is only visible via the status bar.

Unfortunately, there is no way to do it via component settings. But you can try and change css:
your-tiny-mce-textarea .mce-path.mce-flow-layout-item {
display: none !important;
}
UPD: This one seems more pretty:
your-tiny-mce-textarea.mce-statusbar {
border: 0 !important;
}
your-tiny-mce-textarea.mce-path {
display: none !important;
}

Maybe this will help someone in future, you can remove the entire status bar with the following option
tinymce.init({
selector: 'textarea', // change this value according to your HTML
statusbar: false
});
https://www.tiny.cloud/docs/configure/editor-appearance/#statusbar

Related

Ag-Grid treeData: Possible to hide text next to chevron?

I'm working on using treeData, but was wondering if it is possible to hide the text next to the chevron.
For example, can I hide the letters from the column in this table, and just show the chevron? Maybe using cell renderer?
You can do that even without using cellRenderer.
Include below styles in your component declaration.
styles: [`
::ng-deep [class^='ag-row-group-indent-'] .ag-group-value {
display: none;
}
`]
Working plunk: Ag-Grid treeData: Possible to hide text next to chevron
Figured out an easy fix within the column def:
cellRendererParams: {
innerRenderer: () => ''
}

CodeMirror : how to limit height in editor

I am using codemirror to show some code on a webpage. But when I initialize the codemirror editor, the height of the editor is way more than the number of lines in the code. Please see this fiddle or below image to understand what I am saying Below is the code to create the codemirror editor.
var myCodeArea = document.getElementById("codeArea");
var myCodeMirror = CodeMirror(function(elt) {
myCodeArea.parentNode.replaceChild(elt, myCodeArea);
}, {value: myCodeArea.innerHTML,
lineNumbers:true, mode:"javascript"});
I read codemirror doc but not able to figure out which property controls the height.
Please help me with this
The height can be set through CSS (by giving the .CodeMirror class a height property), or by calling the editor's setSize method.
If you want the editor height to correspond to the height of it's contents, see this demo.
If you see your fiddle, there is an entry in css which defines height.
.CodeMirror {
/* Set height, width, borders, and global font properties here */
font-family: monospace;
height: 300px;
}
You can either override this css or use setSize(width,height) method of codemirror.
Might help someone.
<textarea class="form-control" id="exampleTextarea"></textarea>
.
var config, editor;
config = {
lineNumbers: true,
mode: "text/javascript",
lineWrapping: true,
htmlMode: true,
matchClosing: true,
indentWithTabs: true,
readOnly: true
};
editor = CodeMirror.fromTextArea(document.getElementById("exampleTextarea"), config);
editor.setSize(900,"100%");

How to disable default 'Click to edit' on Jeditable?

I'm using the jeditable plugin for making some values editable. I noticed that when a value is empty the default text 'Click top edit' appears which I don't want. But I still want to make that field editable too. How to manage this?
I noticed a suggestion at http://www.datatables.net/forums/discussion/5865/jeditable-and-default-click-to-edit/p1, but that does not seem to work - at least not for me; when using the placeholder : "" the field is not editable anymore.
My related code:
$('.edit').editable('edit_save.php', {
cancel : 'Cancel',
submit : 'OK'
});//$('.edit').editable('jeditable_save.php', {
Without any text to fill it, the editable element needs to be an inline block with height and width like this:
.edit {
border: 1px solid red;
display: inline-block;
min-height: 20px;
min-width: 100px;
}
and set a blank placeholder like you mentioned:
$('.edit').editable(function (value, settings) {
return value;
}, {
cssclass: 'editing',
placeholder: '',
});
See this fiddle http://jsfiddle.net/chrisdillon/37JqF/
I tried add this row: placeholder:'
&
nbsp;' and it works.
If you can add this row, you see your input is empty.
$('.edit').editable('Something', {
something,...
placeholder:' ',
})

tinyMCE: set padding of editor

How do I set the padding inside the tinyMCE editor?
I've seen answers like so:
body{ padding:0px }
But it shouldn't be on the body??
Have look at the tinymce config param content_css. Using this param you may set your own css stuff and overwrite tinymcedefault css. You may apply the padding to whatever element you want (under body)
you could also try these methods:
tinymce.init({
selector: 'textarea', // change this value according to your HTML
// set whatever class name you have that adds the padding
body_class: 'my_class',
// or attach your own css file (resolved to http://domain/myLayout.css)
content_css : '/myLayout.css',
// or finally, add your padding directly
content_style: "body {padding: 10px}"
});
see the docs for more info
If you need a quick solution try the CSS definition:
div.mce-edit-area{
background:#FFF;
filter:none;
>>> padding:10px; <<<
}
in the skin.min.css and skin.ie7.min.css files.

Tinymce resize vertical only

Is there anyway to force tinymce to resize vertical only? It breaks my layout when resized horizontal.
So that this works the same as a default textarea resize: vertical;
tinymce.init({
selector: 'textarea', // change this value according to your HTML
resize: true
});
resize option has 3 values:
false: to disable.
true: enable only Vertical resize
'both': enable both resize directions
check the Documentation
IMPORTANT NOTE: to make it work you have to enable the statusbar option, it's enabled by default, but in case if turned it to statusbar: false you will have to re-enable it statusbar: true
you can use:
tinyMCE.init({
// other stuff...
theme_advanced_resizing : true,
theme_advanced_resize_horizontal : false
});