WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: Front-End Editor] can I use an onclick event instead of doubleclick? (7 posts)

  1. Matthew Gerring
    Member
    Posted 4 years ago #

    Does anyone know of a way to make the front-end editor plugin activate via an onclick event instead of double-clicking where you want to edit?

    Thx much.

  2. scribu
    Member
    Posted 4 years ago #

    The reason it uses doubleclick is so that links can still work. If you don't care about that, you can edit inc/editor.js:

    replace these lines (18-20)

    field.el.click(field.click);
    
    field.el.dblclick(function(ev)

    with this:

    field.el.click(function(ev)

    Refresh your browser cache after this.

    This is not tested, but it should work.

  3. Matthew Gerring
    Member
    Posted 4 years ago #

    I meant clicking on something like an "edit this" link instead of clicking on the text at all. I'm using this plugin to enable certain users to edit things inline, and I'd like to be able to hide the link.

  4. scribu
    Member
    Posted 4 years ago #

    The problem with that is visual clutter: usually, there are a lot of editable elements on a single page.

    Maybe something while hovering on an element would be better.

  5. Matthew Gerring
    Member
    Posted 4 years ago #

    In this case, there aren't going to be any editable elements on the page except for the body text- this is for a wiki-like setup. In any case, what's the function to call onclick (or whatever) to open the front-end editor and load text into it?

  6. scribu
    Member
    Posted 4 years ago #

    There isn't one, because it's not that simple.

    In version 1.2, the user will see a yellow background when hovering over an editable element. You could just put a notice at the bottom of the page, saying something like "Double click on the yellow area to edit."

  7. Matthew Gerring
    Member
    Posted 4 years ago #

    OK, that'll do. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic