From a7751512ffd1ecae7287a158f9519ed03bd83ffb Mon Sep 17 00:00:00 2001 From: kristoffer Date: Fri, 8 Jul 2016 16:09:05 +0200 Subject: [PATCH] Make it possible to override localStorage namespace, falling back to the old bad default for now --- build/dat.gui.js | 6 +++--- src/dat/gui/GUI.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build/dat.gui.js b/build/dat.gui.js index bbfcea4..f2731fc 100644 --- a/build/dat.gui.js +++ b/build/dat.gui.js @@ -2604,11 +2604,11 @@ dat.GUI = dat.gui.GUI = (function (css, saveDialogueContents, styleSheet, contro } 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 addSaveMenu(gui) { var div = gui.__save_row = document.createElement('li'); diff --git a/src/dat/gui/GUI.js b/src/dat/gui/GUI.js index d06d8e9..ec544e3 100644 --- a/src/dat/gui/GUI.js +++ b/src/dat/gui/GUI.js @@ -1109,11 +1109,11 @@ define([ } 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 addSaveMenu(gui) { var div = gui.__save_row = document.createElement('li');