-
-
Notifications
You must be signed in to change notification settings - Fork 933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sort of 3 optionlist at failsafe tab #3211
Conversation
Kudos, SonarCloud Quality Gate passed!
|
Do you want to test this code? Here you have an automated build: |
AUTOMERGE: (FAIL)
|
@@ -265,8 +268,13 @@ failsafe.initialize = function (callback) { | |||
$('input[name="gps_rescue_throttle_max"]').val(FC.GPS_RESCUE.throttleMax); | |||
$('input[name="gps_rescue_throttle_hover"]').val(FC.GPS_RESCUE.throttleHover); | |||
$('input[name="gps_rescue_min_sats"]').val(FC.GPS_RESCUE.minSats); | |||
// Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text | |||
$('#failsafeGpsRescueItemSanitySelect').sortSelect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we follow similar patter to above of using name
instead of id
? so we don't need extra property to keep in sync and this would look like:
$('#failsafeGpsRescueItemSanitySelect').sortSelect(); | |
$('select[name"gps_rescue_sanity_checks"]').sortSelect(); |
@@ -249,6 +249,9 @@ failsafe.initialize = function (callback) { | |||
break; | |||
} | |||
|
|||
// Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text | |||
$('#failsafeSwitchSelect').sortSelect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$('#failsafeSwitchSelect').sortSelect(); | |
$('select[name="failsafe_switch_mode"]').sortSelect(); |
@@ -47,7 +47,7 @@ | |||
<div class="spacer_box"> | |||
<div class="number"> | |||
<label> | |||
<select class="switchMode" name="failsafe_switch_mode"> | |||
<select id="failsafeSwitchSelect" class="switchMode" name="failsafe_switch_mode"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need special ids for this. In general name
is a good unique property and is required for accesibility etc.
<select id="failsafeSwitchSelect" class="switchMode" name="failsafe_switch_mode"> | |
<select class="switchMode" name="failsafe_switch_mode"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think ids are necessary and for consistency using name would be better.
Use of common sortSelect