Ticket #59 (assigned enhancement)

Opened 1 year ago

Last modified 1 year ago

Make Indent/Outdent buttons gray out when not applicable

Reported by: rostr Assigned to: jf.hovinne (accepted)
Priority: minor Milestone: 0.5
Component: Editor Version: trunk
Keywords: Cc:

Description

I have users that want to use the "indent" button to indent paragraphs (when it is obviously done with the css on the page.

Any chance we could gray out these buttons when they don't apply?

Change History

07/11/07 17:09:23 changed by jf.hovinne

  • status changed from new to assigned.

My quick fix:

Add the following to postInit:

$j(wym._doc).bind("keyup", {wym: wym}, toggleIndent);
$j(wym._doc).bind("click", {wym: wym}, toggleIndent);

And in $j(function() {}):

function toggleIndent(event) {
    
    var wym = event.data.wym;
    var container = wym.container();
    if(container && container.tagName.toLowerCase() == WYM_LI) {
        $j(wym._options.toolsSelector).find('.wym_tools_indent').show();
        $j(wym._options.toolsSelector).find('.wym_tools_outdent').show();
    } else {
        $j(wym._options.toolsSelector).find('.wym_tools_indent').hide();
        $j(wym._options.toolsSelector).find('.wym_tools_outdent').hide();
    }
};

A better solution than show/hide would be to update the images, but it requires a little bit more work.
Could be implemented as a plugin, if you have some time.

Perhaps the SAPI (planned for 0.5) will help.

09/06/07 13:45:15 changed by jf.hovinne

  • priority changed from trivial to minor.
  • milestone changed from 0.4 to 0.5.