mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 11:05:55 +00:00
prevent creation of filter rules matching no feeds
This commit is contained in:
20
js/form/ValidationMultiSelect.js
Normal file
20
js/form/ValidationMultiSelect.js
Normal file
@@ -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;
|
||||
},
|
||||
})
|
||||
});
|
||||
Reference in New Issue
Block a user