- Notifications
You must be signed in to change notification settings - Fork5.5k
Add save as menu option#3289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
fd25ae1ee79a7f9b18d0784e565ceab1e7081c6eed0c81fc3File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2854,7 +2854,7 @@ define([ | ||
| } | ||
| var that = this; | ||
| var current_dir = $('body').attr('data-notebook-path').split('/').slice(0, -1).join("/"); | ||
| current_dir = current_dir?current_dir + "/": ""; | ||
| var dialog_body = $('<div/>').append( | ||
| $('<p/>').addClass('save-message') | ||
| .text(i18n.msg._('Enter a notebook path relative to notebook dir')) | ||
| @@ -2896,7 +2896,12 @@ define([ | ||
| }; | ||
| return that.contents.save(nb_path, model) | ||
| .then(function(data) { | ||
| d.modal('hide'); | ||
| that.notebook_name = data.name; | ||
| that.notebook_path = data.path; | ||
| that.session.rename_notebook(data.path); | ||
| that.events.trigger('notebook_renamed.Notebook', data); | ||
| },function(error) { | ||
| console.error(i18n.msg._(error.message || 'Unknown error saving notebook')); | ||
| }); | ||
| @@ -2924,6 +2929,12 @@ define([ | ||
| }, | ||
| }, | ||
| open : function () { | ||
| d.find('input[type="text"]').keydown(function (event) { | ||
| if (event.which === keyboard.keycodes.enter) { | ||
| d.find('.btn-primary').first().click(); | ||
| return false; | ||
| } | ||
| }); | ||
| d.find('input[type="text"]').focus().select(); | ||
| ||
| } | ||
| }); | ||