Skip to content

Commit

Permalink
Don't click cycle through alternating or reversible oneway states
Browse files Browse the repository at this point in the history
(closes #4970)

They are still supported as translated strings, and user can still enter these
values in the raw tag editor, but they should not toggle with clicks in the
checkbox field.  This is because novice users are confused by what they mean.
  • Loading branch information
bhousel committed Apr 9, 2018
1 parent f0d8583 commit 7bf544c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion modules/ui/fields/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,17 @@ export function uiFieldCheck(field, context) {

input
.on('click', function() {
d3_event.stopPropagation();
var t = {};
t[field.key] = values[(values.indexOf(_value) + 1) % values.length];

// Don't cycle through `alternating` or `reversible` states - #4970
// (They are supported as translated strings, but should not toggle with clicks)
if (t[field.key] === 'reversible' || t[field.key] === 'alternating') {
t[field.key] = values[0];
}

dispatch.call('change', this, t);
d3_event.stopPropagation();
});

if (field.type === 'onewayCheck') {
Expand Down

0 comments on commit 7bf544c

Please sign in to comment.