mirror of
https://github.com/jupyter/notebook.git
synced 2024-11-27 03:20:27 +08:00
use events.one for notebook first-load
rather than reimplementing with on/off.
This commit is contained in:
parent
de0360d7d9
commit
f5e3844787
@ -133,17 +133,14 @@ require([
|
||||
|
||||
page.show();
|
||||
|
||||
var first_load = function () {
|
||||
events.one('notebook_loaded.Notebook', function () {
|
||||
var hash = document.location.hash;
|
||||
if (hash) {
|
||||
document.location.hash = '';
|
||||
document.location.hash = hash;
|
||||
}
|
||||
notebook.set_autosave_interval(notebook.minimum_autosave_interval);
|
||||
// only do this once
|
||||
events.off('notebook_loaded.Notebook', first_load);
|
||||
};
|
||||
events.on('notebook_loaded.Notebook', first_load);
|
||||
});
|
||||
|
||||
IPython.page = page;
|
||||
IPython.notebook = notebook;
|
||||
|
Loading…
Reference in New Issue
Block a user