NicolasCARPi / jquery_jeditable

jQuery edit in place plugin. Extendable via plugin architecture. Plugins for plugin. Really.
https://jeditable.elabftw.net
MIT License
1.74k stars 458 forks source link

jeditable destroys user tooltips #241

Closed sronsiek closed 2 years ago

sronsiek commented 2 years ago

Description

jeditable version: 2.0.19

My data contains (valuable) tooltip info which is passed from the server.

To prevent jeditable from overwriting this (default set within jeditable = 'Click to edit'), I need to set the tooltip option to null or false.

But following an edit, my tooltips have disappeared.

Cause is a missing check before overwriting the tooltip at the end of in form.on('submit', function(e):

Changing this:

                    /* Show tooltip again. */
                    $(self).attr('title', settings.tooltip);
                    return false;

to:

                    /* Show tooltip again. */
                    if (settings.tooltip) {
                       $(self).attr('title', settings.tooltip);
                    }
                    return false;

fixes the issue.

Comment: I would think it more intuitive if there was no default set - so if the user does not set a value, jeditable should not interfere with this attribute.

This was the behaviour in 1.7.3.

NicolasCARPi commented 2 years ago

I would think it more intuitive if there was no default set - so if the user does not set a value, jeditable should not interfere with this attribute.

I agree, but I won't make breaking changes now.

I have commited your proposed change!

sronsiek commented 2 years ago

Great, thanks. Some more suggestions in the pipeline ... I'll be back ;) (will raise fresh issues).