# HG changeset patch # User veltr # Date 1372344261 -7200 # Node ID f752e362bf626992371a076db37847059e87a42a # Parent dde608cfd82356fd909958729d62e41da4c772f6 Changed behaviour on click diff -r dde608cfd823 -r f752e362bf62 integration/v2/js/keyword-mosaic.js --- a/integration/v2/js/keyword-mosaic.js Thu Jun 27 16:36:57 2013 +0200 +++ b/integration/v2/js/keyword-mosaic.js Thu Jun 27 16:44:21 2013 +0200 @@ -70,15 +70,18 @@ li.append(texta); kw.li = li; li.click(function() { - if (kw.enabled) { + var allothersdisabled = keywordslist.reduce(function(mem, k) { + return mem && (k === kw || !k.enabled); + }, true); + if (allothersdisabled) { + keywordslist.forEach(function(k) { + k.enabled = true; + }); + } else { keywordslist.forEach(function(k) { k.enabled = false; }); kw.enabled = true; - } else { - keywordslist.forEach(function(k) { - k.enabled = true; - }); } updateKeywords(); return false;