The populate function in jquery.editinline.js isn't bound to elem -----------------------------------------------------------------
Key: COUCHDB-924
URL: https://issues.apache.org/jira/browse/COUCHDB-924
Project: CouchDB
Issue Type: Improvement
Components: HTTP Interface
Reporter: Andrew Fresh
Priority: Minor
I wanted a populate function like this and it didn't work that way.
populate: function(value) { return doc[ this.id ] },
So, I came up with the patch below. It looks like the rest of the
options functions get called the way I changed it, so I am not sure if
there was a specific reason that one got to be different, but I like it
better this way.
Index: share/www/script/jquery.editinline.js
===================================================================
--- share/www/script/jquery.editinline.js (revision 1022364)
+++ share/www/script/jquery.editinline.js (working copy)
@@ -15,7 +15,7 @@
function startEditing(elem, options) {
var editable = $(elem);
var origHtml = editable.html();
- var origText = options.populate($.trim(editable.text()));
+ var origText = options.populate.apply(elem, [$.trim(editable.text())]);
if (!options.begin.apply(elem, [origText])) {
return;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
