##// 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 YUD.get('pull_request_overview').innerHTML = "${_('Loading ...')}";
158 YUD.get('pull_request_overview').innerHTML = "${_('Loading ...')}";
159 ypjax(url,'pull_request_overview');
160
159 YUD.get('pull_request_overview_url').href = url; // shouldn't have as_form ... but ...
161 YUD.get('pull_request_overview_url').href = url; // shouldn't have as_form ... but ...
160 YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display','');
162 YUD.setStyle(YUD.get('pull_request_overview_url').parentElement,'display','');
161 ypjax(url,'pull_request_overview', function(data){
163
162 var sel_box = YUQ('#pull_request_form #other_repo')[0];
164 var sel_box = YUQ('#pull_request_form #other_repo')[0];
163 var repo_name = sel_box.options[sel_box.selectedIndex].value;
165 var repo_name = sel_box.options[sel_box.selectedIndex].value;
164 YUD.get('other_repo_desc').innerHTML = other_repos_info[repo_name]['description'];
166
165 // replace options of other_ref with the ones for the current other_repo
167 YUD.get('other_repo_desc').innerHTML = other_repos_info[repo_name]['description'];
166 var other_ref_selector = YUD.get('other_ref');
168 // replace options of other_ref with the ones for the current other_repo
167 var new_select = YUD.createElementFromMarkup(other_repos_info[repo_name]['revs']);
169 var other_ref_selector = YUD.get('other_ref');
168 var new_selectedIndex = new_select.selectedIndex;
170 var new_select = YUD.createElementFromMarkup(other_repos_info[repo_name]['revs']);
169 other_ref_selector.innerHTML = ""; // clear old options
171 var new_selectedIndex = new_select.selectedIndex;
170 while (new_select.length > 0){ // children will be popped when appened to other_ref_selector
172 other_ref_selector.innerHTML = ""; // clear old options
171 other_ref_selector.appendChild(new_select.children[0]);
173 while (new_select.length > 0){ // children will be popped when appened to other_ref_selector
172 }
174 other_ref_selector.appendChild(new_select.children[0]);
173 // browsers lost track of selected when appendChild was used
175 }
174 other_ref_selector.selectedIndex = new_selectedIndex;
176 // browsers lost track of selected when appendChild was used
175 // reset && add the reviewer based on selected repo
177 other_ref_selector.selectedIndex = new_selectedIndex;
176 var _data = other_repos_info[repo_name];
178
177 YUD.get('review_members').innerHTML = '';
179 // reset && add the reviewer based on selected repo
178 addReviewMember(_data.user.user_id, _data.user.firstname,
180 var _data = other_repos_info[repo_name];
179 _data.user.lastname, _data.user.username,
181 YUD.get('review_members').innerHTML = '';
180 _data.user.gravatar_link);
182 addReviewMember(_data.user.user_id, _data.user.firstname,
181 })
183 _data.user.lastname, _data.user.username,
184 _data.user.gravatar_link);
182 }
185 }
183
186
184 ## refresh automatically when something changes (org_repo can't change)
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