mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 16:17:59 +01:00
Make Option.validateCompleter the default validator: look out for minor breakage.
This commit is contained in:
@@ -198,12 +198,7 @@ const Option = Class("Option", {
|
||||
* Returns whether the specified <b>values</b> are valid for this option.
|
||||
* @see Option#validator
|
||||
*/
|
||||
isValidValue: function (values) {
|
||||
if (this.validator)
|
||||
return this.validator(values);
|
||||
else
|
||||
return true;
|
||||
},
|
||||
isValidValue: function (values) this.validator(values),
|
||||
|
||||
/**
|
||||
* Resets the option to its default value.
|
||||
@@ -370,7 +365,11 @@ const Option = Class("Option", {
|
||||
* @property {function} The function called to validate the option's value
|
||||
* when set.
|
||||
*/
|
||||
validator: null,
|
||||
validator: function () {
|
||||
if (this.completer)
|
||||
return Option.validateCompleter.apply(this, arguments);
|
||||
return true;
|
||||
},
|
||||
/**
|
||||
* @property The function called to determine whether the option already
|
||||
* contains a specified value.
|
||||
|
||||
Reference in New Issue
Block a user