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

Get Selected Container?

Support forum for WYMeditor.

Get Selected Container?

Postby Stephen on Thu Jan 03, 2008 5:32 pm

Hi everyone,

I know there is a method: getSelectedContainer() in version 0.2.2 to get selected container using the current cursor position.

But how can I do the same in the new version? can anyone point me the correct method to use?

many thanks.

Stephen
Stephen
 
Posts: 2
Joined: Thu Jan 03, 2008 5:25 pm

Postby avallo on Sun Jan 13, 2008 1:25 am

i would also like to know this, i didn't see this post when i posted the same thing earlier today. i want to be able to hide classes when an element is selected that the class can't be applied to.
avallo
 
Posts: 11
Joined: Fri Sep 21, 2007 3:47 pm

Heres how i did it...

Postby avallo on Sun Jan 13, 2008 7:12 am

Code: Select all
postInit: function(wym) {

  $(wym._box).click(function(){
     if(wym.selected() != undefined){
         alert(wym.selected().tagName);
     }
  });

}


you have to have the "$(wym._box)" or it wont work..
i guess its not the prettiest thing in the world.. But thats the only way i found to do it...

you can use jQuery functions like so:

Code: Select all
var E = wym.selected();
$(E).attr("class");


if anyone knows a better way Please Let Me Know.

Thanks,
Weston
avallo
 
Posts: 11
Joined: Fri Sep 21, 2007 3:47 pm


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests