couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "A. Bram Neijt (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COUCHDB-924) The populate function in jquery.editinline.js isn't bound to elem
Date Mon, 08 Nov 2010 12:02:25 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12929555#action_12929555
] 

A. Bram Neijt commented on COUCHDB-924:
---------------------------------------

This bugs needs more clarification.

Please clarify what the problem is, what the outcome should be and (if usefull) hint at which
solution might help. This reads like "I have a patch, please apply it??".

> 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
>   Original Estimate: 0.17h
>  Remaining Estimate: 0.17h
>
> 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.


Mime
View raw message