Changeset - b845d1e94e2e
[Not reviewed]
default
0 1 0
Takumi IINO - 11 years ago 2014-11-29 08:04:48
trot.thunder@gmail.com
javascripts: replace YUI with jquery in kallithea/templates/pullrequests/pullrequest_show.html

This patch removes the '.show-inline-comments' event handler.
'.show-inline-comments' does not exist in diff_block.diff_block_simple,
it exists in diff_block.diff_block.
1 file changed with 4 insertions and 21 deletions:
0 comments (0 inline, 0 general)
kallithea/templates/pullrequests/pullrequest_show.html
Show inline comments
 
@@ -337,43 +337,26 @@ ${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, _GROUPS_AC_DATA);
 

	
 
          YUE.on(YUQ('.show-inline-comments'),'change',function(e){
 
              var show = 'none';
 
              var target = e.currentTarget;
 
              if(target.checked){
 
                  var show = ''
 
              }
 
              var boxid = YUD.getAttribute(target,'id_for');
 
              var comments = YUQ('#{0} .inline-comments'.format(boxid));
 
              for(c in comments){
 
                 YUD.setStyle(comments[c],'display',show);
 
              }
 
              var btns = YUQ('#{0} .inline-comments-button'.format(boxid));
 
              for(c in btns){
 
                  YUD.setStyle(btns[c],'display',show);
 
               }
 
          })
 

	
 
          YUE.on(YUQ('.add-bubble'),'click',function(e){
 
          $('.add-bubble').click(function(e){
 
              var tr = e.currentTarget;
 
              injectInlineForm(tr.parentNode.parentNode);
 
          });
 

	
 
          // inject comments into they proper positions
 
          var file_comments = YUQ('.inline-comment-placeholder');
 
          var file_comments = $('.inline-comment-placeholder').toArray();
 
          renderInlineComments(file_comments);
 

	
 
          linkInlineComments(document.getElementsByClassName('firstlink'), document.getElementsByClassName("inline-comment"));
 

	
 
          YUE.on(YUD.get('update_pull_request'),'click',function(e){
 
          $('#update_pull_request').click(function(e){
 
              updateReviewers(undefined, "${c.repo_name}", "${c.pull_request.pull_request_id}");
 
          })
 
          });
 

	
 
          // hack: re-navigate to target after JS is done ... if a target is set and setting href thus won't reload
 
          if (window.location.hash != "") {
 
              window.location.href = window.location.href;
 
          }
 
      })
0 comments (0 inline, 0 general)