Forum closed. New forum available at http://community.wymeditor.org/

Turn Classes selector into dropdown

Support forum for WYMeditor.

Turn Classes selector into dropdown

Postby fyankai on Wed Dec 12, 2007 4:03 pm

Hi

First of all, thank you - just found this thing and it's brilliant!

Am trying to turn the Classes selector into a dropdown menu like the Container selector. From some code in another post, I've got down to this:

Code: Select all
fPostInit: function(wym) {      
   jQuery(wym._box).find(wym._options.sClassesSelector)
   .addClass("wym_dropdown")
   .find(sWYM_H2)
   .append("<span>&nbsp;&gt;</span>");
}


But that doesn't seem to do anything. Does anyone know an easy way to do this? Sorry, my JS isn't very advanced, so much as I tried, I can't figure it out from the source code.

Thanks loads,

Frank
fyankai
 
Posts: 2
Joined: Wed Dec 12, 2007 3:57 pm

Postby pcdinh on Sat Dec 22, 2007 7:58 pm

Try this

Code: Select all
         jQuery(wym._box)
            //first we have to select them:
            .find(".wym_area_top .wym_classes")
            //then we remove the existing class which make some of them render as a panels:
            .removeClass("wym_panel")
            //then we add the class which will make them render as a dropdown menu:
            .addClass("wym_dropdown")
            //finally we add some css to make the dropdown menus look better:
            .css("width", "160px")
            .css("float", "left")
            .css("margin-right", "5px")
            .find("ul")
            .css("width", "140px");
pcdinh
 
Posts: 3
Joined: Sat Dec 22, 2007 1:56 pm

Postby fyankai on Mon Dec 24, 2007 1:47 pm

Great, thanks, will give that a go...
fyankai
 
Posts: 2
Joined: Wed Dec 12, 2007 3:57 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest