Skip to content

Commit 9490f89

Browse files
committed
Merge pull request #41 from schwuk/comments_for_directories
Comments for directories
2 parents 7e475ca + 4335952 commit 9490f89

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

code_comments/htdocs/code-comments.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,14 @@ var underscore = _.noConflict();
167167
},
168168
render: function() {
169169
this.$el.html(this.template({formatting_help_url: CodeComments.formatting_help_url}))
170-
.dialog({ autoOpen: false, title: 'Add Comment', close: this.close });
170+
.dialog({ autoOpen: false, title: 'Add Comment', close: this.close, modal: true });
171+
// As the textarea in our dialog is created after Trac's
172+
// keyboard_nav.js has bound, we have to stop keydown events
173+
// propoagating in order to avoid unexpected navigation while the
174+
// user is typing their comment.
175+
this.$el.keydown(function(e) {
176+
event.stopPropagation();
177+
});
171178
this.$('button.add-comment').button();
172179
return this;
173180
},

code_comments/web.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def changeset_js_data(self, req, data):
109109
return {'page': 'changeset', 'revision': data['new_rev'], 'path': '', 'selectorToInsertBefore': 'div.diff:first'}
110110

111111
def browser_js_data(self, req, data):
112-
return {'page': 'browser', 'revision': data['rev'], 'path': data['path'], 'selectorToInsertBefore': 'table#info'}
112+
return {'page': 'browser', 'revision': data['rev'], 'path': data['path'], 'selectorToInsertBefore': 'table#info, table#dirlist'}
113113

114114
def attachment_js_data(self, req, data):
115115
path = req.path_info.replace('/attachment/', 'attachment:/')

0 commit comments

Comments
 (0)