Permalink
Browse files

Save button becomes Rename when the notebook name changes.

  • Loading branch information...
1 parent bdb89a7 commit 507621d411c9f4f11d345cda0efefe1e1b7dfca3 @ellisonbg ellisonbg committed Aug 19, 2011
Showing with 12 additions and 1 deletion.
  1. +12 −1 IPython/frontend/html/notebook/static/js/savewidget.js
@@ -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;

0 comments on commit 507621d

Please sign in to comment.