1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-08-02 12:05:23 +02:00

Enable doc section expand/collapse

Closes #170
This commit is contained in:
HarveyKandola 2019-06-05 11:09:24 +01:00
parent 99a5418dba
commit 8baad7e2f0
22 changed files with 229 additions and 102 deletions

View file

@ -26,5 +26,24 @@ export default Service.extend({
clearAll() {
localStorage.clear();
}
},
getDocSectionHide(docId) {
let state = localStorage[`doc-hide-${docId}`];
if (_.isUndefined(state) || _.isEmpty(state)) {
return [];
}
return _.split(state, '|');
},
setDocSectionHide(docId, state) {
let key = `doc-hide-${docId}`;
if (state.length === 0) {
delete localStorage[key];
} else {
localStorage[key] = _.join(state, '|');
}
},
});