Can I hook the edit block dialog box resize event?
Permalink
Hi
I have extended the HTML editor block to provide advanced functionality using code mirror (http://codemirror.net).
I have tried using 100% height to have the editor fill the block edit dialog but I couldn't get that working as I'd hoped so I decided to specify a static height and resize the editor when the dialog resizes but I can't catch the resize event. (See attached before and after)
I have tried..
This fires when the dialog is first created but not when the dialog is resized. The same is true for (dialogresizestop, dialogresize etc.).
Have I got the wrong selector or is the C5 dialog different to the standard jquery UI model?
Any help appreciated..
I have extended the HTML editor block to provide advanced functionality using code mirror (http://codemirror.net).
I have tried using 100% height to have the editor fill the block edit dialog but I couldn't get that working as I'd hoped so I decided to specify a static height and resize the editor when the dialog resizes but I can't catch the resize event. (See attached before and after)
I have tried..
$( ".ui-dialog-content" ).on( "resize", resizeEditor() );
This fires when the dialog is first created but not when the dialog is resized. The same is true for (dialogresizestop, dialogresize etc.).
Have I got the wrong selector or is the C5 dialog different to the standard jquery UI model?
Any help appreciated..
Thanks.. I had a look through that file and I see there's a lot more js modification going on behind the scenes than I realised.
I got it working in the end by binding an event listener to the jquery resizable selector like this
now when the block edit dialog is resized I can resize the editor to fit.
I got it working in the end by binding an event listener to the jquery resizable selector like this
$(".ui-resizable").on('resizestop', function (event, ui) {//Resize the editor});
now when the block edit dialog is resized I can resize the editor to fit.
I am also not sure about the selector.
The js file to look in in the core is called something like 'legacy dialog'