Merge pull request #4569 from minrk/persist-celltoolbar

store cell toolbar preset in notebook metadata
This commit is contained in:
Matthias Bussonnier 2013-11-28 07:06:36 -08:00
commit 2a2a5d5a53
3 changed files with 11 additions and 2 deletions

View File

@ -214,7 +214,7 @@ var IPython = (function (IPython) {
*
* CellToolbar.activate_preset('foo.foo_preset1');
*/
CellToolbar.activate_preset= function(preset_name){
CellToolbar.activate_preset = function(preset_name){
var preset = CellToolbar._presets[preset_name];
if(preset != undefined){

View File

@ -147,9 +147,11 @@ var IPython = (function (IPython) {
var val = $(this).val()
if (val =='') {
IPython.CellToolbar.global_hide();
delete IPython.notebook.metadata.celltoolbar;
} else {
IPython.CellToolbar.global_show();
IPython.CellToolbar.activate_preset(val);
IPython.notebook.metadata.celltoolbar = val;
}
});
// Setup the currently registered presets.

View File

@ -1958,7 +1958,14 @@ var IPython = (function (IPython) {
this.start_session();
}
// load our checkpoint list
IPython.notebook.list_checkpoints();
this.list_checkpoints();
// load toolbar state
if (this.metadata.celltoolbar) {
IPython.CellToolbar.global_show();
IPython.CellToolbar.activate_preset(this.metadata.celltoolbar);
}
$([IPython.events]).trigger('notebook_loaded.Notebook');
};