Save button becomes Rename when the notebook name changes.

This commit is contained in:
Brian E. Granger 2011-08-18 20:23:03 -07:00
parent f35f9323e6
commit cbe3563d8d

View File

@ -26,11 +26,12 @@ var IPython = (function (IPython) {
SaveWidget.prototype.style = function () {
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();
var left_panel_width = $('div#left_panel').outerWidth();
var left_panel_splitter_width = $('div#left_panel_splitter').outerWidth();
$('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();
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;
return IPython;