mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-27 04:20:22 +08:00
Make widgets persist across page refresh
This commit is contained in:
parent
3d9e43f0c4
commit
3b11cc66a7
@ -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
|
||||
//--------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user