|
Lines 482-493
Link Here
|
| 482 |
.then(resolve, reject); |
482 |
.then(resolve, reject); |
| 483 |
}) |
483 |
}) |
| 484 |
.then(function(profiles) { |
484 |
.then(function(profiles) { |
|
|
485 |
var setDefault = false; |
| 485 |
profiles.forEach(function(profile) { |
486 |
profiles.forEach(function(profile) { |
| 486 |
const opt = $("<option/>"); |
487 |
const opt = $("<option/>"); |
| 487 |
select.append(opt); |
488 |
select.append(opt); |
| 488 |
if(id && profile.profile_id == id) { |
489 |
if(id) { |
|
|
490 |
if(id && profile.profile_id == id) { |
| 489 |
opt.prop('selected', true); |
491 |
opt.prop('selected', true); |
|
|
492 |
} |
| 490 |
} |
493 |
} |
|
|
494 |
else if (setDefault == false) { |
| 495 |
opt.prop('selected', true); |
| 496 |
|
| 497 |
} |
| 498 |
setDefault = true; |
| 491 |
opt.attr("value", profile.profile_id); |
499 |
opt.attr("value", profile.profile_id); |
| 492 |
opt.text(profile.name); |
500 |
opt.text(profile.name); |
| 493 |
opt.data("profile", profile); |
501 |
opt.data("profile", profile); |
| 494 |
- |
|
|