Last active
May 31, 2017 18:45
-
-
Save acl0056/e16499863c25f22f90e5aa4abdb7fa85 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If localStorage is not really required, this will at least provide storage while the app is running. | |
var storage = typeof window.localStorage !== "unknown" ? window.localStorage : { | |
getItem: function(key) { | |
return (this.items || (this.items = {}))[key]; | |
}, | |
setItem: function(key, value) { | |
(this.items || (this.items = {}))[key] = value; | |
}, | |
clear: function() { | |
this.items = {} | |
}, | |
removeItem: function() { | |
delete (this.items || (this.items = {}))[key]; | |
} | |
}; | |
// And later, where you passed in window.localStorage, pass in storage instead. | |
TourService.prototype.start = function() { | |
this.tour = new window.Tour({ | |
name: "ConfiguratorTour", | |
steps: [], | |
container: "body", | |
smartPlacement: !0, | |
keyboard: !0, | |
storage: storage, | |
debug: !1, | |
backdrop: !0, | |
backdropContainer: "body", | |
backdropPadding: 0, | |
redirect: !0, | |
orphan: !1, | |
duration: !1, | |
delay: !1, | |
basePath: "" | |
}) | |
// ... And change | |
// window.localStorage.clear() | |
// to | |
storage.clear() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment