Changeset - c5dde6b5e976
[Not reviewed]
beta
0 1 0
Mads Kiilerich - 13 years ago 2013-02-04 15:54:35
madski@unity3d.com
pull request: only bind action to other_repo change once
1 file changed with 7 insertions and 6 deletions:
0 comments (0 inline, 0 general)
rhodecode/templates/pullrequests/pullrequest.html
Show inline comments
 
@@ -166,30 +166,31 @@
 
      }; // gather the org/other ref and repo here
 
      
 
      for (k in rev_data){
 
    	  url = url.replace('__'+k+'__',rev_data[k]);
 
      }
 

	
 
      YUE.on('other_repo', 'change', function(e){
 
          var repo_name = e.currentTarget.value;
 
          // replace the <select> of changed repo
 
          YUD.get('other_ref').innerHTML = other_repos_info[repo_name]['revs'];
 
      });
 

	
 
      ypjax(url,'pull_request_overview', function(data){
 
          var sel_box = YUQ('#pull_request_form #other_repo')[0];
 
          var repo_name = sel_box.options[sel_box.selectedIndex].value;
 
          YUD.get('pull_request_overview_url').href = url;
 
          YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display','');
 
          YUD.get('other_repo_gravatar').src = other_repos_info[repo_name]['gravatar'];
 
          YUD.get('other_repo_desc').innerHTML = other_repos_info[repo_name]['description'];
 
          YUD.get('other_ref').innerHTML = other_repos_info[repo_name]['revs'];
 
          // select back the revision that was just compared
 
          setSelectValue(YUD.get('other_ref'), rev_data['other_ref']);
 
      })
 
  }
 

	
 
  YUE.on('other_repo', 'change', function(e){
 
      var repo_name = e.currentTarget.value;
 
      // replace the <select> of changed repo
 
      YUD.get('other_ref').innerHTML = other_repos_info[repo_name]['revs'];
 
  });
 

	
 
  YUE.on('refresh','click',function(e){
 
     loadPreview()
 
  })
 

	
 
  //lazy load overview after 0.5s
 
  setTimeout(loadPreview, 500)
0 comments (0 inline, 0 general)