// Verify that single_option group has at least one item selected
if (
this.getType() === 'single_option' &&
// Verify that single_option group has at least one item selected
if (
this.getType() === 'single_option' &&
if ( this.getType() === 'single_option' ) {
// This group must have one item selected always
// and must never have more than one item selected at a time
if ( this.getType() === 'single_option' ) {
// This group must have one item selected always
// and must never have more than one item selected at a time
// Nothing is selected anymore
// Select the default or the first item
this.currSelected = this.getItemByParamName( this.defaultParams[ this.getName() ] ) ||
this.getItems()[ 0 ];
this.currSelected.toggleSelected( true );
changed = true;
// Nothing is selected anymore
// Select the default or the first item
this.currSelected = this.getItemByParamName( this.defaultParams[ this.getName() ] ) ||
this.getItems()[ 0 ];
this.currSelected.toggleSelected( true );
changed = true;
// There is more than one item selected
// This should only happen if the item given
// is the one that is selected, so unselect
// all items that is not it
// There is more than one item selected
// This should only happen if the item given
// is the one that is selected, so unselect
// all items that is not it
// Note that in case the given item is actually
// not selected, this loop will end up unselecting
// all items, which would trigger the case above
// Note that in case the given item is actually
// not selected, this loop will end up unselecting
// all items, which would trigger the case above
* @param {mw.rcfilters.dm.FilterItem} [excludeItem] Item to exclude from the list
* @return {mw.rcfilters.dm.FilterItem[]} Selected items
*/
* @param {mw.rcfilters.dm.FilterItem} [excludeItem] Item to exclude from the list
* @return {mw.rcfilters.dm.FilterItem[]} Selected items
*/
var excludeName = ( excludeItem && excludeItem.getName() ) || '';
return this.getItems().filter( function ( item ) {
var excludeName = ( excludeItem && excludeItem.getName() ) || '';
return this.getItems().filter( function ( item ) {
* @return {boolean} All selected items are in conflict with this item
*/
mw.rcfilters.dm.FilterGroup.prototype.areAllSelectedInConflictWith = function ( filterItem ) {
* @return {boolean} All selected items are in conflict with this item
*/
mw.rcfilters.dm.FilterGroup.prototype.areAllSelectedInConflictWith = function ( filterItem ) {
* @return {boolean} Any of the selected items are in conflict with this item
*/
mw.rcfilters.dm.FilterGroup.prototype.areAnySelectedInConflictWith = function ( filterItem ) {
* @return {boolean} Any of the selected items are in conflict with this item
*/
mw.rcfilters.dm.FilterGroup.prototype.areAnySelectedInConflictWith = function ( filterItem ) {