Fixed Cannot remove individual block bb code editor buttons

Siropu

Well-known member
Affected version
2.1
In XF 2.0.x you can disable code, icode, quote, etc, individually using the editor remove-button attribute but not in XF 2.1.
 
Thank you for reporting this issue. It has now been resolved and we are aiming to include it in a future XF release (2.1.0 B7/RC1).

Change log:
Refactor editor button management in JS to allow button removal in dropdowns using a new button manager object. (Note: this changes the editor:toolbar-buttons JS event, so be aware if you're using this in 2.1.)
Any changes made as a result of this issue being resolved may not be rolled out here until later.
 
@Chris D

What's the proper way to use this in a template? Been playing with it for an hour now and can't seem to get it.

Edit: I've tried adding data-buttons-remove="_extended,_align,_indent" to xf:editrow as you mentioned here, but it has no effect.

Code:
        <xf:editorrow name="message" value="{$message}" data-min-height="250"
            attachments="{$attachmentData.attachments}"
            rowtype=""
            data-buttons-remove="_extended,_align,_indent"
            label="{{ phrase('label') }}"
            explain="{{ phrase('explain') }}"/>

1639414940180.webp
 
Last edited:
Nevermind, got it working with this (y)

Code:
        <xf:set var="$disabledButtons" value="{{ ['_extended','_align','_indent','bold'] }}" />
        <xf:editorrow name="message" value="{$message}" data-min-height="250"
            attachments="{$attachmentData.attachments}"
            rowtype=""
            removebuttons="{$disabledButtons}"
            label="{{ phrase('details') }}"
            explain="{{ phrase('explain') }}"/>
 
Back
Top Bottom