AnanthaKN / jquery-in-place-editor

Automatically exported from code.google.com/p/jquery-in-place-editor
Other
0 stars 0 forks source link

callback does not receive original_element but original_element.attr('id') #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If I set a callback function (like on the demo page), it makes more sense
to pass that the original_element instead of the original_elemten's ID;
// Using a callback function to update 2 divs
    $(".editme4").editInPlace({
        callback: function(original_element, html, original){
            ...
            return(html);
        }
    });

It would be usefull to have a reference to the original object edited.

Changing line 205 to:

html = settings.callback(original_element, new_html, original_html,
settings.params);

solves this for me (removed .attr("id") from original_element)

Original issue reported on code.google.com by mvansch...@gmail.com on 29 Sep 2009 at 10:19

GoogleCodeExporter commented 9 years ago
Why not just do $('#' + originalID) to get back at the element?

Regards,
Martin

Original comment by martin.h...@googlemail.com on 14 Feb 2010 at 1:45

GoogleCodeExporter commented 9 years ago
Yeah, I've thought about this too, but I haven't acted as this would not be 
backwards compatible and I've shied a 
way from doing changes that break compatibility as much as possible.

Definitely something I'd like to do sometime though.

Original comment by mhaec...@gmail.com on 23 Mar 2010 at 10:09

GoogleCodeExporter commented 9 years ago
This is implemented in trunk, please have a look and see if it fixes your issue 
(this is not set to the dom node of 
the editor). If not, please feel free to reopen this issue.

Original comment by mhaec...@gmail.com on 14 May 2010 at 9:12