Skip to content

Instantly share code, notes, and snippets.

@gabrielengel
Last active December 10, 2015 15:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save gabrielengel/4452796 to your computer and use it in GitHub Desktop.
// Editor specific listener
editor.on("aftercommand:composer", resize); // Set bold, italic, etc
editor.on("change_view", resize); // Change wysi/source view
// Typing listeners
editor.on("newword:composer", resize); // Only way to observe on firefox
editor.on("undo:composer", resize);
editor.on("paste", resize);
iframeBody.addEventListener('keyup', resize, false);
iframeBody.addEventListener("keydown", resize, false);
iframeBody.addEventListener("keypress", resize, false);
// Focus/Blur listeners
editor.on("focus", resize);
editor.on("blur", resize);
iframeBody.addEventListener('blur', resize, false);
iframeBody.addEventListener('focus', resize, false);
// Set the first size
editor.on("load", resize);
resize();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment