From: Jakub Skoczen Date: Thu, 3 Mar 2011 09:30:50 +0000 (+0100) Subject: Avoid empty arrays when splitting X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=bfbf487d0a960af59d12fd8bff4518996667454f;p=mkdru-moved-to-drupal.org.git Avoid empty arrays when splitting --- diff --git a/mkdru.client.js b/mkdru.client.js index ddda649..0044663 100644 --- a/mkdru.client.js +++ b/mkdru.client.js @@ -145,8 +145,9 @@ mkdru.pz2Term = function (data) { // map all facets against selected, for simple rendering var hash = $.deparam.fragment(); for (var key in hash) { - if (key.indexOf('limit') == 0) //always wrap in array - hash[key.substr(6)] = hash[key].split(';'); + if (key.indexOf('limit') == 0 && hash[key]) + //always wrap in array + hash[key.substr(6)] = hash[key].split(/;+/); delete hash[key]; } for (var facet in mkdru.facets) {