Show More
@@ -217,6 +217,12 b' ReviewersController = function () {' | |||
|
217 | 217 | prButtonLock(true, null, 'reviewers'); |
|
218 | 218 | $('#user').hide(); // hide user autocomplete before load |
|
219 | 219 | |
|
220 | if (sourceRef.length !== 3 || targetRef.length !== 3) { | |
|
221 | // don't load defaults in case we're missing some refs... | |
|
222 | $('.calculate-reviewers').hide(); | |
|
223 | return | |
|
224 | } | |
|
225 | ||
|
220 | 226 | var url = pyroutes.url('repo_default_reviewers_data', |
|
221 | 227 | { |
|
222 | 228 | 'repo_name': templateContext.repo_name, |
@@ -202,9 +202,13 b'' | |||
|
202 | 202 | // translate our select2 id into a text, it's a mapping to show |
|
203 | 203 | // simple label when selecting by internal ID. |
|
204 | 204 | var id, refData; |
|
205 | if (selectedRef === undefined) { | |
|
205 | if (selectedRef === undefined || selectedRef === null) { | |
|
206 | 206 | id = element.val(); |
|
207 | 207 | refData = element.val().split(':'); |
|
208 | ||
|
209 | if (refData.length !== 3){ | |
|
210 | refData = ["", "", ""] | |
|
211 | } | |
|
208 | 212 | } else { |
|
209 | 213 | id = selectedRef; |
|
210 | 214 | refData = selectedRef.split(':'); |
@@ -216,7 +220,6 b'' | |||
|
216 | 220 | } |
|
217 | 221 | |
|
218 | 222 | var data = {id: id, text: text}; |
|
219 | ||
|
220 | 223 | callback(data); |
|
221 | 224 | }; |
|
222 | 225 | }; |
@@ -415,8 +418,10 b'' | |||
|
415 | 418 | }; |
|
416 | 419 | }; |
|
417 | 420 | |
|
418 | var initTargetRefs = function(refsData, selectedRef){ | |
|
421 | var initTargetRefs = function(refsData, selectedRef) { | |
|
422 | ||
|
419 | 423 | Select2Box($targetRef, { |
|
424 | placeholder: "${_('Select commit reference')}", | |
|
420 | 425 | query: function(query) { |
|
421 | 426 | queryTargetRefs(refsData, query); |
|
422 | 427 | }, |
@@ -518,7 +523,9 b'' | |||
|
518 | 523 | % if c.default_source_ref: |
|
519 | 524 | // in case we have a pre-selected value, use it now |
|
520 | 525 | $sourceRef.select2('val', '${c.default_source_ref}'); |
|
526 | // diff preview load | |
|
521 | 527 | loadRepoRefDiffPreview(); |
|
528 | // default reviewers | |
|
522 | 529 | reviewersController.loadDefaultReviewers( |
|
523 | 530 | sourceRepo(), sourceRef(), targetRepo(), targetRef()); |
|
524 | 531 | % endif |
General Comments 0
You need to be logged in to leave comments.
Login now