mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
collapsible.js: Don't use Set features which IE11 doesn't support
This commit is contained in:
parent
ec2a6b5c78
commit
9a6b1cffd6
@ -146,7 +146,10 @@
|
|||||||
Collapsible.prototype.loadStorage = function () {
|
Collapsible.prototype.loadStorage = function () {
|
||||||
var expanded = localStorage.getItem('behavior.collapsible.expanded');
|
var expanded = localStorage.getItem('behavior.collapsible.expanded');
|
||||||
if (!! expanded) {
|
if (!! expanded) {
|
||||||
this.expanded = new Set(JSON.parse(expanded));
|
// .forEach() is used because IE11 doesn't support constructor arguments
|
||||||
|
JSON.parse(expanded).forEach(function (value) {
|
||||||
|
this.expanded.add(value);
|
||||||
|
}, this);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -155,7 +158,13 @@
|
|||||||
*/
|
*/
|
||||||
Collapsible.prototype.destroy = function () {
|
Collapsible.prototype.destroy = function () {
|
||||||
if (this.expanded.size > 0) {
|
if (this.expanded.size > 0) {
|
||||||
localStorage.setItem('behavior.collapsible.expanded', JSON.stringify(Array.from(this.expanded.values())));
|
var expanded = [];
|
||||||
|
// .forEach() is used because IE11 doesn't support .values()
|
||||||
|
this.expanded.forEach(function(value) {
|
||||||
|
expanded.push(value);
|
||||||
|
});
|
||||||
|
|
||||||
|
localStorage.setItem('behavior.collapsible.expanded', JSON.stringify(expanded));
|
||||||
} else {
|
} else {
|
||||||
localStorage.removeItem('behavior.collapsible.expanded');
|
localStorage.removeItem('behavior.collapsible.expanded');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user