|
1 | 1 | (function($) { $(function() { |
2 | | - var jQuery = $; // just in case something uses jQuery() instead of $() |
3 | | - var _ = window.underscore; |
| 2 | + var _ = window.underscore, |
| 3 | + jQuery = $; // just in case something uses jQuery() instead of $() |
4 | 4 | $(document).ajaxError( function(e, xhr, options){ |
5 | 5 | var errorText = xhr.statusText; |
6 | 6 | if (-1 == xhr.responseText.indexOf('<html')) { |
|
156 | 156 | this.$("ul.comments").append(view.render().el); |
157 | 157 | }, |
158 | 158 | showAddCommentDialog: function() { |
159 | | - var $parentRow = $( this.el ).prev()[0]; |
160 | | - var $th = ( $( 'th', $parentRow ).length) ? $( 'th', $parentRow ) : $parentRow, |
| 159 | + var $parentRow = $( this.el ).prev()[0], |
| 160 | + $th = ( $( 'th', $parentRow ).length) ? $( 'th', $parentRow ) : $parentRow, |
161 | 161 | $item = $th.last(), |
162 | 162 | file = $item.parents( 'li' ).find( 'h2>a:first' ).text(), |
163 | | - line = $.inArray( $parentRow, CodeComments.$tableRows ) + 1; |
164 | | - |
165 | | - var displayLine = $item.text().trim() || $th.first().text() + ' (deleted)'; |
| 163 | + line = $.inArray( $parentRow, CodeComments.$tableRows ) + 1, |
| 164 | + displayLine = $item.text().trim() || $th.first().text() + ' (deleted)'; |
166 | 165 |
|
167 | 166 | AddCommentDialog.open( LineComments, this.line, file, displayLine ); |
168 | 167 | } |
|
185 | 184 | return this; |
186 | 185 | }, |
187 | 186 | open: function( collection, line, file, displayLine ) { |
| 187 | + var title = this.buildDialogTitle( line, file, displayLine ); |
188 | 188 | this.line = line; |
189 | 189 | this.collection = collection; |
190 | | - var title = this.buildDialogTitle( line, file, displayLine ); |
191 | 190 | this.$el.dialog( 'open' ).dialog( { title: title } ); |
192 | 191 | }, |
193 | 192 | buildDialogTitle: function( line, file, displayLine ) { |
|
242 | 241 | var $th = ( $( 'th', this ).length) ? $( 'th', this ) : $( this ), |
243 | 242 | $item = $th.last(), |
244 | 243 | file = $item.parents( 'li' ).find( 'h2>a:first' ).text(), |
245 | | - line = $.inArray( this, CodeComments.$tableRows ) + 1; |
246 | | - |
247 | | - var displayLine = $item.text().trim() || $th.first().text() + ' (deleted)'; |
| 244 | + line = $.inArray( this, CodeComments.$tableRows ) + 1, |
| 245 | + displayLine = $item.text().trim() || $th.first().text() + ' (deleted)'; |
248 | 246 |
|
249 | 247 | $item.children().css( 'display', 'none' ); |
250 | 248 |
|
|
0 commit comments