Implemented [bb_code_edit] - Make buttons not only depend on a group

cclaerhout

Well-known member
The new "insert" group now has the "quote", "code", "deleted" and new "spoiler" buttons configuration, but this configuration is not a "reference". Which means if some board admins want to make them independent buttons (to avoid the dropdown), they can't unless if they rewrite the JavaScript which would be quite a waste since the code is already there.

So these buttons configuration could be in the parent level of the object then do something like this:

Code:
        insert: {
           title: this.getText('insert'),
           func: 'show',
           dropdown:
           {
             quote: buttonsCustom.quote,
             spoiler: buttonsCustom.spoiler,
             code: buttonsCustom.code,
             deleted: buttonsCustom.delete
           }
         }
 
Upvote 0
This suggestion has been implemented. Votes are no longer accepted.
There may be dropdown specific options in there (className) that could potentially change the behavior at the top level, though that doesn't happen now.

But regardless, some level of JS would need to be written for the buttons (and possibly CSS), so couldn't you just reference buttonsCustom.insert.dropdown.xyz to set up your button anyway? (I suppose moving this out would save one line of setting up the button definition.)
 
There may be dropdown specific options in there (className) that could potentially change the behavior at the top level, though that doesn't happen now.

But regardless, some level of JS would need to be written for the buttons (and possibly CSS), so couldn't you just reference buttonsCustom.insert.dropdown.xyz to set up your button anyway? (I suppose moving this out would save one line of setting up the button definition.)
Thank you for your reply. For the reference, yes I can do it, but It would have been nice to only use the editor setup listener to manage this with php.
 
Top Bottom