couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Fresh <and...@afresh1.com>
Subject Small patch for jquery.editinline.js
Date Fri, 15 Oct 2010 03:32:37 GMT
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.

l8rZ,
-- 
andrew - ICQ# 253198 - Jabber: andrew@rraz.net - Twitter: @AFreshOne

Adding manpower to a late software project makes it later.

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;                                                                           
                              


Mime
View raw message