diff options
author | Johan Sørensen <johan@johansorensen.com> | 2009-10-19 13:59:10 +0200 |
---|---|---|
committer | Johan Sørensen <johan@johansorensen.com> | 2009-11-04 15:23:31 +0100 |
commit | 8a851debdd988f0fe66fffcb291217dcc75dfbec (patch) | |
tree | f1ee9ed52e91b24bf5480dafc1f233d9d12338c6 /public/javascripts | |
parent | 489f31a600fcc36d07394d1be2039f909af70af2 (diff) | |
download | gitorious-mainline-outdated-8a851debdd988f0fe66fffcb291217dcc75dfbec.zip gitorious-mainline-outdated-8a851debdd988f0fe66fffcb291217dcc75dfbec.tar.gz gitorious-mainline-outdated-8a851debdd988f0fe66fffcb291217dcc75dfbec.tar.bz2 |
Add an observer notification whenever we show the CommentForm in the diff browser
Diffstat (limited to 'public/javascripts')
-rw-r--r-- | public/javascripts/diff_browser.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/public/javascripts/diff_browser.js b/public/javascripts/diff_browser.js index 7c82ae0..83930f8 100644 --- a/public/javascripts/diff_browser.js +++ b/public/javascripts/diff_browser.js @@ -163,13 +163,14 @@ Gitorious.DiffBrowser = function(shas) var shaSpec = new Gitorious.ShaSpec(); shaSpec.parseShas(shas); Gitorious.MergeRequestController.getInstance().didReceiveVersion(shaSpec); - NotificationCenter.notifyObservers("DiffBrowserDidReloadDiffs", - this); + NotificationCenter.notifyObservers("DiffBrowserDidReloadDiffs", this); } }, "error": function(xhr, statusText, errorThrown) { - jQuery("#merge_request_diff").html("<div class=\"merge_request_diff_loading_indicator\">" + - "An error has occured. Please try again later.</div>"); + jQuery("#merge_request_diff").html( + '<div class="merge_request_diff_loading_indicator">' + + "An error has occured. Please try again later.</div>" + ); } }); } @@ -245,6 +246,8 @@ Gitorious.DiffBrowser.KeyNavigation = { }; NotificationCenter.addObserver("DiffBrowserDidReloadDiffs", Gitorious.DiffBrowser, Gitorious.DiffBrowser.KeyNavigation.enable, this); +NotificationCenter.addObserver("DiffBrowserWillPresentCommentForm", Gitorious.DiffBrowser, + Gitorious.DiffBrowser.KeyNavigation.disable, this); Gitorious.MergeRequestController = function() { this.willSelectShas = function() { @@ -429,7 +432,7 @@ Gitorious.CommentForm = function(path){ return "Commenting on lines " + this.linesAsString() + " in " + this.path; } this.display = function(options) { - Gitorious.DiffBrowser.KeyNavigation.disable(); + NotificationCenter.notifyObservers("DiffBrowserWillPresentCommentForm", this); var comment_form = jQuery("#inline_comment_form"); var hash = document.location.hash; var commentContainer = options.inside; |