1
0
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:
Kris Maglione
2009-11-13 21:50:06 -05:00
parent a75ef9a540
commit a9e8d9d691
11 changed files with 25 additions and 46 deletions

View File

@@ -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.