Skip to content
This repository was archived by the owner on Jul 29, 2022. It is now read-only.
This repository was archived by the owner on Jul 29, 2022. It is now read-only.

Need ability to define target function in terms of click target #67

@estebistec

Description

@estebistec

I like to avoid hard-coding URLs in my JS. To that end, I tend to put them as data-attributes on my elements. This way I can have my templating technology (e.g. django template language or haml) appropriately resolve the URL and attach it to the element in this way. This also helps keep my JS static and not also templates (a choice that we could debate, but that's the choice I've made).

So, using that practice with jquery_jeditable, I would want to have a data attribute for the target. Currently, if the target argument is a function it receives the edit-value and settings object. This leaves me without the target element to read attributes off of this.

I can currently work around it by calling editable on each element individually, e.g., by setting each up in a $(".editable").each(function(e) {}) block, but this is not quite ideal. It would be nice if the target resolution support built-in were more robust, and the target function could receive the original elements to read data attributes off of.

Since I have a workaround, this isn't urgent. I wouldn't mind submitting the pull request if I can set aside some time in the intermediate future, but that won't be right now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions