##// END OF EJS Templates
pullrequest: don't do in the ajax callback what can be done in no time right now
Mads Kiilerich -
r3513:a2a61978 beta
parent child Browse files
Show More
@@ -156,29 +156,32
156 156 }
157 157
158 158 YUD.get('pull_request_overview').innerHTML = "${_('Loading ...')}";
159 ypjax(url,'pull_request_overview');
160
159 161 YUD.get('pull_request_overview_url').href = url; // shouldn't have as_form ... but ...
160 162 YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display','');
161 ypjax(url,'pull_request_overview', function(data){
162 var sel_box = YUQ('#pull_request_form #other_repo')[0];
163 var repo_name = sel_box.options[sel_box.selectedIndex].value;
164 YUD.get('other_repo_desc').innerHTML = other_repos_info[repo_name]['description'];
165 // replace options of other_ref with the ones for the current other_repo
166 var other_ref_selector = YUD.get('other_ref');
167 var new_select = YUD.createElementFromMarkup(other_repos_info[repo_name]['revs']);
168 var new_selectedIndex = new_select.selectedIndex;
169 other_ref_selector.innerHTML = ""; // clear old options
170 while (new_select.length > 0){ // children will be popped when appened to other_ref_selector
171 other_ref_selector.appendChild(new_select.children[0]);
172 }
173 // browsers lost track of selected when appendChild was used
174 other_ref_selector.selectedIndex = new_selectedIndex;
175 // reset && add the reviewer based on selected repo
176 var _data = other_repos_info[repo_name];
177 YUD.get('review_members').innerHTML = '';
178 addReviewMember(_data.user.user_id, _data.user.firstname,
179 _data.user.lastname, _data.user.username,
180 _data.user.gravatar_link);
181 })
163
164 var sel_box = YUQ('#pull_request_form #other_repo')[0];
165 var repo_name = sel_box.options[sel_box.selectedIndex].value;
166
167 YUD.get('other_repo_desc').innerHTML = other_repos_info[repo_name]['description'];
168 // replace options of other_ref with the ones for the current other_repo
169 var other_ref_selector = YUD.get('other_ref');
170 var new_select = YUD.createElementFromMarkup(other_repos_info[repo_name]['revs']);
171 var new_selectedIndex = new_select.selectedIndex;
172 other_ref_selector.innerHTML = ""; // clear old options
173 while (new_select.length > 0){ // children will be popped when appened to other_ref_selector
174 other_ref_selector.appendChild(new_select.children[0]);
175 }
176 // browsers lost track of selected when appendChild was used
177 other_ref_selector.selectedIndex = new_selectedIndex;
178
179 // reset && add the reviewer based on selected repo
180 var _data = other_repos_info[repo_name];
181 YUD.get('review_members').innerHTML = '';
182 addReviewMember(_data.user.user_id, _data.user.firstname,
183 _data.user.lastname, _data.user.username,
184 _data.user.gravatar_link);
182 185 }
183 186
184 187 ## refresh automatically when something changes (org_repo can't change)
General Comments 0
You need to be logged in to leave comments. Login now