Ticket #59 (assigned enhancement)

Opened 5 years ago

Last modified 2 years ago

Make Indent/Outdent buttons gray out when not applicable

Reported by: rostr Owned by: mr_lundis
Priority: minor Milestone: 2.0
Component: ui 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

comment:1 Changed 5 years ago 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.

comment:2 Changed 5 years ago by jf.hovinne

  • Priority changed from trivial to minor
  • Milestone changed from 0.4 to 0.5

comment:3 Changed 2 years ago by mr_lundis

  • Component changed from editor to ui

comment:4 Changed 2 years ago by mr_lundis

  • Owner changed from jf.hovinne to mr_lundis
  • Status changed from assigned to new

Related to #141.

comment:5 Changed 2 years ago by mr_lundis

  • Status changed from new to assigned
  • Milestone changed from 0.5 to 0.6
Note: See TracTickets for help on using tickets.