#29360 closed defect (bug) (worksforme)
How I can disable the `auto-height` in Editor?
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.0 |
Component: | Editor | Keywords: | |
Focuses: | Cc: |
Description
Continue from here: #28328
Hey.. I just want to know how I can disable the resize height in Editor. I use the wp_editor()
in Model, and it's not work good.
Screenshot: http://i.imgur.com/mTtpaC5.png
Change History (12)
#2
follow-up:
↓ 4
@
11 years ago
This code: http://pastebin.com/Ah68hwnG
This ticket was mentioned in IRC in #wordpress-dev by helen. View the logs.
11 years ago
#4
in reply to:
↑ 2
;
follow-up:
↓ 5
@
11 years ago
Replying to KingYes:
You are copying the TinyMCE init object from the "main" editor _.extend( {}, tinyMCEPreInit.mceInit.content );
. It has wp_autoresize_on: true
which enables the auto-resize. Either set that to false or delete it. Some other settings may need tweaking/adjusting as that init object is meant for the "main" editor only.
#5
in reply to:
↑ 4
;
follow-up:
↓ 6
@
11 years ago
Replying to azaozz:
How I can disable wp_autoresize_on: true
after TinyMCE get ready on my Popup?
#6
in reply to:
↑ 5
;
follow-up:
↓ 9
@
11 years ago
Replying to KingYes:
As I mentioned above, you have to set it to false after you copy the init object:
window.tinyMCEPreInit.mceInit[ last_element_id ] = _.extend({}, tinyMCEPreInit.mceInit.content); window.tinyMCEPreInit.mceInit[ last_element_id ].wp_autoresize_on = false;
It's not the best idea to blindly copy the init object. There may be other settings (including settings added by other plugins) that could interfere.
#8
@
11 years ago
- Milestone Awaiting Review deleted
- Resolution set to worksforme
- Status changed from new to closed
#9
in reply to:
↑ 6
;
follow-up:
↓ 10
@
11 years ago
Replying to azaozz:
Replying to KingYes:
As I mentioned above, you have to set it to false after you copy the init object:
window.tinyMCEPreInit.mceInit[ last_element_id ] = _.extend({}, tinyMCEPreInit.mceInit.content); window.tinyMCEPreInit.mceInit[ last_element_id ].wp_autoresize_on = false;It's not the best idea to blindly copy the init object. There may be other settings (including settings added by other plugins) that could interfere.
This is messy, what about a PHP filter?
#10
in reply to:
↑ 9
@
11 years ago
Replying to nacin:
Was thinking about a PHP filter too. It won't work in this case (this is specific for the hack @KingYes is using in JS).
Currently to disable editor expand, the script has to be deregistered and wp_autoresize_on
unset. Something like:
add_action( 'admin_init', 'my_deregister_editor_expand' ); function my_deregister_editor_expand() { wp_deregister_script('editor-expand'); } add_filter( 'tiny_mce_before_init', 'my_unset_autoresize_on' ); function my_unset_autoresize_on( $init ) { unset( $init['wp_autoresize_on'] ); return $init; }
That's pretty easy but having a filter will make it more straightforward.
Can you please provide some code snippet/test plugin which you're using?