From da4fd02a7fc71ffdbd548a1cdd065dbd31d68d29 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 11 May 2016 19:56:06 +0000 Subject: [PATCH] If there are 2 or less options for a filterheader, disable multiple toggle --- api/js/etemplate/et2_extension_nextmatch.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/api/js/etemplate/et2_extension_nextmatch.js b/api/js/etemplate/et2_extension_nextmatch.js index d294805207..d52e2da919 100644 --- a/api/js/etemplate/et2_extension_nextmatch.js +++ b/api/js/etemplate/et2_extension_nextmatch.js @@ -3292,6 +3292,19 @@ var et2_nextmatch_filterheader = (function(){ "use strict"; return et2_taglist.e this._super.apply(this, arguments); }, + /** + * Disable toggle if there are 2 or less options + * @param {Object[]} options + */ + set_select_options: function(options) + { + if(options && options.length <= 2 && this.options.multiple == 'toggle') + { + this.set_multiple(false) + } + this._super.apply(this, arguments); + }, + /** * Set nextmatch is the function which has to be implemented for the * et2_INextmatchHeader interface.