use events.one for notebook first-load

rather than reimplementing with on/off.
This commit is contained in:
Min RK 2015-09-14 14:42:35 +02:00
parent de0360d7d9
commit f5e3844787

View File

@ -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;