Changeset - 99d29f43bdd1
[Not reviewed]
default
0 2 0
Mads Kiilerich - 11 years ago 2015-08-11 12:39:07
madski@unity3d.com
comments: bind comment-bubble click handler to table and use sub selector

Avoid jQuery looping over all lines and binding comment-bubble click handler to
every line on page load.

Avoids 'Maximum call stack size exceeded' when loading a huge diff in Chrome.
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/changeset/changeset.html
Show inline comments
 
@@ -221,13 +221,13 @@ ${self.repo_context_bar('changelog', c.c
 
              }else{
 
                  $('#{0} .inline-comments'.format(boxid)).hide();
 
                  $('#{0} .inline-comments-button'.format(boxid)).hide();
 
              }
 
          });
 

	
 
          $('.add-bubble').click(function(e){
 
          $('.code-difftable').on('click', '.add-bubble', function(e){
 
              show_comment_form($(this));
 
          });
 

	
 
          move_comments($(".comments .comments-list-chunk"));
 

	
 
          pyroutes.register('changeset_home',
kallithea/templates/pullrequests/pullrequest_show.html
Show inline comments
 
@@ -373,13 +373,13 @@ ${self.repo_context_bar('showpullrequest
 
                       is_pr=True, change_status=c.allowed_to_change_status)}
 

	
 
    <script type="text/javascript">
 
      $(document).ready(function(){
 
          PullRequestAutoComplete('user', 'reviewers_container', _USERS_AC_DATA);
 

	
 
          $('.add-bubble').click(function(e){
 
          $('.code-difftable').on('click', '.add-bubble', function(e){
 
              show_comment_form($(this));
 
          });
 

	
 
          var avail_jsdata = ${c.avail_jsdata|n};
 
          var avail_r = new BranchRenderer('avail_graph_canvas', 'updaterevs-table', 'chg_available_');
 
          avail_r.render(avail_jsdata,40);
0 comments (0 inline, 0 general)