summaryrefslogtreecommitdiff
path: root/js/form
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-21 12:28:25 +0300
committerAndrew Dolgov <[email protected]>2021-02-21 12:28:25 +0300
commit810afdaf5a429468d31b09ae5a7f995dd11568f8 (patch)
tree0b0a7a50046be26a77123c119cb48d3ae21f0ce9 /js/form
parentfb471652c00abec604e07c2383685c0e352c897e (diff)
prevent creation of filter rules matching no feeds
Diffstat (limited to 'js/form')
-rw-r--r--js/form/ValidationMultiSelect.js20
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;
+ },
+ })
+ });