http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95680

Revision: 95680
Author:   hashar
Date:     2011-08-29 17:31:47 +0000 (Mon, 29 Aug 2011)
Log Message:
-----------
(bug 30617) inline comments forms cannot be closed

On clicking a line, a javascript insert a <tr> element containg the
form. That <tr> did not get an unique id which caused troubles when
opening multiples inline comments.

This patch forge an id based on the diff line it applies to which should
be unique since we only allow one comment form per line.

Modified Paths:
--------------
    trunk/extensions/CodeReview/modules/ext.codereview.linecomment.js

Modified: trunk/extensions/CodeReview/modules/ext.codereview.linecomment.js
===================================================================
--- trunk/extensions/CodeReview/modules/ext.codereview.linecomment.js   
2011-08-29 17:16:53 UTC (rev 95679)
+++ trunk/extensions/CodeReview/modules/ext.codereview.linecomment.js   
2011-08-29 17:31:47 UTC (rev 95680)
@@ -17,9 +17,11 @@
         * @param lineCode jQuery object
         */
        lcShowForm: function( lineCode ) {
+               var htmlId = 'comment-for-' + lineCode.attr('id');
+
                lineCode.unbind( 'click' );
                lineCode.click( function () {
-                       $( '#lineComment' ).fadeOut( 200 ).remove();
+                       $( '#'+htmlId ).fadeOut( 200 ).remove();
 
                        lineCode.unbind( 'click' );
                        lineCode.click( function() {
@@ -28,7 +30,7 @@
                });
 
                var lineComment =
-               $('<tr id="lineComment"><td colspan="3">'
+               $('<tr id="' + htmlId + '"><td colspan="3">'
                +'<textarea id="lineCommentContent" rows="5"></textarea><br/>'
                +'<input id="lineCommentSend" type="button" value="Send">'
                +'</td></tr>');


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to