##// END OF EJS Templates
Save button becomes Rename when the notebook name changes.
Brian E. Granger -
Show More
@@ -26,11 +26,12 b' var IPython = (function (IPython) {'
26
26
27 SaveWidget.prototype.style = function () {
27 SaveWidget.prototype.style = function () {
28 this.element.find('input#notebook_name').addClass('ui-widget ui-widget-content');
28 this.element.find('input#notebook_name').addClass('ui-widget ui-widget-content');
29 this.element.find('input#notebook_name').attr('tabindex','1');
29 this.element.find('button#save_notebook').button();
30 this.element.find('button#save_notebook').button();
30 var left_panel_width = $('div#left_panel').outerWidth();
31 var left_panel_width = $('div#left_panel').outerWidth();
31 var left_panel_splitter_width = $('div#left_panel_splitter').outerWidth();
32 var left_panel_splitter_width = $('div#left_panel_splitter').outerWidth();
32 $('span#save_widget').css({marginLeft:left_panel_width+left_panel_splitter_width});
33 $('span#save_widget').css({marginLeft:left_panel_width+left_panel_splitter_width});
33 $('input#notebook_name').attr('tabindex','1');
34
34 };
35 };
35
36
36
37
@@ -40,6 +41,9 b' var IPython = (function (IPython) {'
40 IPython.notebook.save_notebook();
41 IPython.notebook.save_notebook();
41 that.set_document_title();
42 that.set_document_title();
42 });
43 });
44 this.element.find('input#notebook_name').change(function () {
45 that.status_rename();
46 });
43 };
47 };
44
48
45
49
@@ -111,6 +115,13 b' var IPython = (function (IPython) {'
111 };
115 };
112
116
113
117
118 SaveWidget.prototype.status_rename = function () {
119 this.element.find('button#save_notebook').button('option', 'label', 'Rename');
120 this.element.find('button#save_notebook').button('enable');
121 IPython.print_widget.enable();
122 };
123
124
114 IPython.SaveWidget = SaveWidget;
125 IPython.SaveWidget = SaveWidget;
115
126
116 return IPython;
127 return IPython;
General Comments 0
You need to be logged in to leave comments. Login now