diff --git a/public/paysagerenderer/visibility_management.js b/public/paysagerenderer/visibility_management.js index 7f2f3ff..7b875d8 100644 --- a/public/paysagerenderer/visibility_management.js +++ b/public/paysagerenderer/visibility_management.js @@ -5,10 +5,8 @@ const ONLY_COMMAND = '#only='; Paysage.readIdsFromUrlHash = function (urlHash) { if (urlHash.startsWith(ONLY_COMMAND)) { - return urlHash.substring(ONLY_COMMAND.length).split(','); - } - if (urlHash === '#none') { - return []; + var idsList = urlHash.substring(ONLY_COMMAND.length); + return idsList === '' ? [] : idsList.split(','); } return undefined; }; diff --git a/spec/public/paysagerenderer/visibility_management_spec.js b/spec/public/paysagerenderer/visibility_management_spec.js index 59572c7..c37ae75 100644 --- a/spec/public/paysagerenderer/visibility_management_spec.js +++ b/spec/public/paysagerenderer/visibility_management_spec.js @@ -6,7 +6,7 @@ describe('The Paysage renderer visibility management', function () { expect(Paysage.readIdsFromUrlHash('#')).toEqual(undefined); expect(Paysage.readIdsFromUrlHash('#only=toto')).toEqual(['toto']); expect(Paysage.readIdsFromUrlHash('#only=toto,titi')).toEqual(['toto', 'titi']); - expect(Paysage.readIdsFromUrlHash('#none')).toEqual([]); + expect(Paysage.readIdsFromUrlHash('#only=')).toEqual([]); }); describe('has code object filtering', function () {