collapsible.js: Use namespace `behavior` for local storage entries
This commit is contained in:
parent
1748404efe
commit
ec2a6b5c78
|
@ -144,7 +144,7 @@
|
||||||
* Load state from storage
|
* Load state from storage
|
||||||
*/
|
*/
|
||||||
Collapsible.prototype.loadStorage = function () {
|
Collapsible.prototype.loadStorage = function () {
|
||||||
var expanded = localStorage.getItem('collapsible.expanded');
|
var expanded = localStorage.getItem('behavior.collapsible.expanded');
|
||||||
if (!! expanded) {
|
if (!! expanded) {
|
||||||
this.expanded = new Set(JSON.parse(expanded));
|
this.expanded = new Set(JSON.parse(expanded));
|
||||||
}
|
}
|
||||||
|
@ -155,9 +155,9 @@
|
||||||
*/
|
*/
|
||||||
Collapsible.prototype.destroy = function () {
|
Collapsible.prototype.destroy = function () {
|
||||||
if (this.expanded.size > 0) {
|
if (this.expanded.size > 0) {
|
||||||
localStorage.setItem('collapsible.expanded', JSON.stringify(Array.from(this.expanded.values())));
|
localStorage.setItem('behavior.collapsible.expanded', JSON.stringify(Array.from(this.expanded.values())));
|
||||||
} else {
|
} else {
|
||||||
localStorage.removeItem('collapsible.expanded');
|
localStorage.removeItem('behavior.collapsible.expanded');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue