mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
Make it possible to set a namespace for localStorage, with fallback to document.location.href. Also prefix with 'dat.gui.' to avoid collisions.
This commit is contained in:
parent
d5b6178e33
commit
5aa551a696
@ -1023,8 +1023,8 @@ function add(gui, object, property, params) {
|
||||
}
|
||||
|
||||
function getLocalStorageHash(gui, key) {
|
||||
// TODO how does this deal with multiple GUI's?
|
||||
return document.location.href + '.' + key;
|
||||
var namespace = localStorage.getItem('dat.gui.namespace') || document.location.href;
|
||||
return 'dat.gui.' + namespace + '.' + key;
|
||||
}
|
||||
|
||||
function addPresetOption(gui, name, setSelected) {
|
||||
|
Loading…
Reference in New Issue
Block a user