Page 1 of 1

<hr /> custom button

PostPosted: Mon Sep 08, 2008 4:09 pm
by mykel_suthertun
I've added a custom button to add horizontal rules. When I click the button, it appears to automatically add another blank paragraph above it, but when I view the source there's no paragraph tag added. I assume it's just a problem with my styles, but I'm not positive.

Here's my custom button js:
Code: Select all
// Horizontal Rule
var html = "<li class='wym_tools_hr'>"
    + "<a name='HorizontalRule' href='##'"
    + " style='background-image:"
    + " url(#request.LayoutRoot#images/icon_wymeditor.png)'>"
    + "Horizontal Rule"
    + "<\/a><\/li>";
//add the button to the tools box
    .find(wym._options.toolsSelector + wym._options.toolsListSelector)
//handle click event
    .find('li.wym_tools_hr a').click(function() {
    //do something
    wym.paste('<hr />');

Do I need to include anything else in my script or my styles to get this to function correctly? Thanks!

Re: <hr /> custom button

PostPosted: Tue Sep 09, 2008 6:28 pm
by mr_lundis
Hi !

You can't use the paste function to insert block-level html into the editor (I know, it's kind of confusing), check out this thread for more info.