mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Save button becomes Rename when the notebook name changes.
This commit is contained in:
parent
f35f9323e6
commit
cbe3563d8d
@ -26,11 +26,12 @@ var IPython = (function (IPython) {
|
|||||||
|
|
||||||
SaveWidget.prototype.style = function () {
|
SaveWidget.prototype.style = function () {
|
||||||
this.element.find('input#notebook_name').addClass('ui-widget ui-widget-content');
|
this.element.find('input#notebook_name').addClass('ui-widget ui-widget-content');
|
||||||
|
this.element.find('input#notebook_name').attr('tabindex','1');
|
||||||
this.element.find('button#save_notebook').button();
|
this.element.find('button#save_notebook').button();
|
||||||
var left_panel_width = $('div#left_panel').outerWidth();
|
var left_panel_width = $('div#left_panel').outerWidth();
|
||||||
var left_panel_splitter_width = $('div#left_panel_splitter').outerWidth();
|
var left_panel_splitter_width = $('div#left_panel_splitter').outerWidth();
|
||||||
$('span#save_widget').css({marginLeft:left_panel_width+left_panel_splitter_width});
|
$('span#save_widget').css({marginLeft:left_panel_width+left_panel_splitter_width});
|
||||||
$('input#notebook_name').attr('tabindex','1');
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -40,6 +41,9 @@ var IPython = (function (IPython) {
|
|||||||
IPython.notebook.save_notebook();
|
IPython.notebook.save_notebook();
|
||||||
that.set_document_title();
|
that.set_document_title();
|
||||||
});
|
});
|
||||||
|
this.element.find('input#notebook_name').change(function () {
|
||||||
|
that.status_rename();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -111,6 +115,13 @@ var IPython = (function (IPython) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
SaveWidget.prototype.status_rename = function () {
|
||||||
|
this.element.find('button#save_notebook').button('option', 'label', 'Rename');
|
||||||
|
this.element.find('button#save_notebook').button('enable');
|
||||||
|
IPython.print_widget.enable();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
IPython.SaveWidget = SaveWidget;
|
IPython.SaveWidget = SaveWidget;
|
||||||
|
|
||||||
return IPython;
|
return IPython;
|
||||||
|
Loading…
Reference in New Issue
Block a user