Skip to content

Commit

Permalink
Remove the #none command since #only= with no ids is doing the job
Browse files Browse the repository at this point in the history
  • Loading branch information
etienneCharignon committed Sep 23, 2018
1 parent 6f3b0f8 commit 09b62ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions public/paysagerenderer/visibility_management.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down
2 changes: 1 addition & 1 deletion spec/public/paysagerenderer/visibility_management_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 09b62ea

Please sign in to comment.