Make widgets persist across page refresh

This commit is contained in:
Jonathan Frederic 2014-12-10 12:29:28 -08:00
parent 3d9e43f0c4
commit 3b11cc66a7

View File

@ -102,6 +102,13 @@ define([
});
};
// Use local storage to persist widgets across page refresh by default.
WidgetManager.set_state_callbacks(function() {
return JSON.parse(localStorage.widgets || '{}');
}, function(state) {
localStorage.widgets = JSON.stringify(state);
});
//--------------------------------------------------------------------
// Instance level
//--------------------------------------------------------------------