I need my users to be able to add a class to just about any element. The only way I have thought this would be done is by modifying elementspath; adding a context menu to items and removing the default range selection on click. The context menu would contain one item that opens a dialog to choose from a (very very large) list of classes. So, is it possible / feasible to add a context menu for elementspath items?
For example I need to users to be able to add CSS classes to the table, tr, td, ul or li element in a situation where the elementspath looks like :
body > table > tbody > tr > td > ul > li
What do you think? Any comments are welcome (especially ideas on implementation, criticism and other ideas how to do this).
This is also a SO question
Thu, 07/26/2012 - 09:56
#1
Re: Context menu for elementspath? (to add class to any elem
I know that some time ago I wrote about several improvements that could be done on that part, but I don't remember the details.
Re: Context menu for elementspath? (to add class to any elem
And then where the elementspath item html is generated I added:
And then I made a plugin that creates a html "context menu"
I feel a bit dirty hacking the core like that and creating a div element for the context menu in that way but it kind of works for me.