From 86f02a7af260dc58579f3112a8e1f812170a370d Mon Sep 17 00:00:00 2001 From: Nikolay Bachiyski Date: Sun, 2 Mar 2014 01:24:14 +0200 Subject: [PATCH] Simplify the mouse out handler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can assume the `this` is the row. From my testing it’s always true. --- code_comments/htdocs/code-comments.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code_comments/htdocs/code-comments.js b/code_comments/htdocs/code-comments.js index f96144d..3e10e9c 100644 --- a/code_comments/htdocs/code-comments.js +++ b/code_comments/htdocs/code-comments.js @@ -231,9 +231,8 @@ }; var callbackMouseout = function( event ) { - var tr = $( 'th', this ).length? this : $( this ).parent().get( 0 ), - row = new RowView( { el: tr } ); - $( 'a.bubble', tr ).remove(); + $( 'a.bubble', this ).remove(); + var row = new RowView( { el: this } ); row.bringBackOriginalLineNumberCellContent(); };