diff options
author | Andrew Dolgov <[email protected]> | 2021-02-21 12:28:25 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-21 12:28:25 +0300 |
commit | 810afdaf5a429468d31b09ae5a7f995dd11568f8 (patch) | |
tree | 0b0a7a50046be26a77123c119cb48d3ae21f0ce9 /js/form/ValidationMultiSelect.js | |
parent | fb471652c00abec604e07c2383685c0e352c897e (diff) |
prevent creation of filter rules matching no feeds
Diffstat (limited to 'js/form/ValidationMultiSelect.js')
-rw-r--r-- | js/form/ValidationMultiSelect.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/js/form/ValidationMultiSelect.js b/js/form/ValidationMultiSelect.js new file mode 100644 index 000000000..4e7263c61 --- /dev/null +++ b/js/form/ValidationMultiSelect.js @@ -0,0 +1,20 @@ +/* global define */ + +// only supports required for the time being +// TODO: maybe show dojo native error message? i dunno +define(["dojo/_base/declare", "dojo/_base/lang", "dijit/form/MultiSelect", ], + function(declare, lang, MultiSelect) { + + return declare('fox.form.ValidationMultiSelect', [MultiSelect], { + constructor: function(params){ + this.constraints = {}; + this.baseClass += ' dijitValidationMultiSelect'; + }, + validate: function(/*Boolean*/ isFocused){ + if (this.required && this.attr('value').length == 0) + return false; + + return true; + }, + }) + }); |