Hi!
Ive made some js functions that resizes the editor when the browser window is resized.
Everything works great until theres a postback. After the postback setSize throws an exception all the time.
The line casuing the exception is. (located in a scriptresource)
ln:5694 c.style.height=""; (c is null)
My code:
var bw_currenteditor;
//function to set editor variable called from editor.OnClientLoad
function contentTemplateEditorInit(editor) {
bw_currenteditor = editor;
}
//function to resize which is called from body.onresize
function ResizeTemplateEditor(editor) {
if (!editor || typeof editor.setSize != "function")
return;
//Get new editor width and height
var h = Math.abs(BWgetContentControlPreviewWindowHeight() - 160);
var w = Math.abs(BWgetContentControlPreviewWindowWidth() - 40);
editor.setSize(w, h);
}