Following from this: TinyMCE editor fixed size with no scrollers?
How can I remove the last inserted code in tinyMCE?
setup : function(ed){
ed.onKeyDown.add(function (ed, evt) {
var currentfr=document.getElementById(ed.id + '_ifr');
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) { //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight + 26;
}
else if (currentfr.Document && currentfr.Document.body.scrollHeight) { //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
}
if( currentfr.height >= 156 ){
// Remove last inserted code here
}
});
},
So if the height is 156 or more, it should remove what you just typed (code).
How can i do this?
I made a few tests and this is what i came up with: