Skip to content

Commit 2b317de

Browse files
committed
Set path of the dialog view on open
Before we were setting it in the buildDialogTitle() method, which wasn't very intuitive.
1 parent 2c83cf2 commit 2b317de

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

code_comments/htdocs/code-comments.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,14 @@
178178
return this;
179179
},
180180
open: function( collection, line, file, displayLine ) {
181-
var title = this.buildDialogTitle( line, file, displayLine );
181+
this.path = ( '' === CodeComments.path ) ? file : CodeComments.path;
182182
this.line = line;
183183
this.collection = collection;
184+
var title = this.buildDialogTitle( line, file, displayLine );
184185
this.$el.dialog( 'open' ).dialog( { title: title } );
185186
},
186187
buildDialogTitle: function( line, file, displayLine ) {
187188
displayLine = displayLine || line;
188-
this.path = ( '' === CodeComments.path ) ? file : CodeComments.path;
189-
190189
var title = 'Add comment for ';
191190
if( '' === CodeComments.path || typeof CodeComments.path === 'undefined' ) {
192191
title += ( displayLine ? 'line ' + displayLine + ' of ' + file + ' in ' : '' )

0 commit comments

Comments
 (0)