Solved issue #4006

This commit is contained in:
Joshua Zeltser 2019-06-20 15:29:09 +01:00
parent a403d59cb0
commit 1a9a096f9c
3 changed files with 11 additions and 3 deletions

View File

@ -234,6 +234,7 @@ define(['jquery',
});
modal_obj.on('shown.bs.modal', function(){ editor.refresh(); });
modal_obj.on('hide.bs.modal', function(){options.edit_metadata_button.focus(); });
};
var edit_attachments = function (options) {

View File

@ -10,7 +10,7 @@ define([
var CellToolbar = celltoolbar.CellToolbar;
var raw_edit = function (cell) {
var raw_edit = function (cell , edit_metadata_button) {
dialog.edit_metadata({
md: cell.metadata,
callback: function (md) {
@ -18,7 +18,8 @@ define([
},
name: i18n.msg._('Cell'),
notebook: this.notebook,
keyboard_manager: this.keyboard_manager
keyboard_manager: this.keyboard_manager,
edit_metadata_button: edit_metadata_button
});
};
@ -28,9 +29,10 @@ define([
.addClass("btn btn-default btn-xs")
.text(i18n.msg._("Edit Metadata"))
.click( function () {
raw_edit(cell);
raw_edit(cell, this);
return false;
});
button_container.append(button);
};

View File

@ -938,6 +938,7 @@ define([
if (this.mode !== 'command') {
cell.command_mode();
this.mode = 'command';
$('div[class*="code_cell"]')
this.events.trigger('command_mode.Notebook');
this.keyboard_manager.command_mode();
}
@ -965,6 +966,10 @@ define([
if (cell && this.mode !== 'edit') {
cell.edit_mode();
this.mode = 'edit';
<<<<<<< HEAD
=======
$('div[class*="code_cell"]')
>>>>>>> 1dbabaa0a... #4006: fixed the edit-metadata button so that focus returns to it after closing the popup
this.events.trigger('edit_mode.Notebook');
this.keyboard_manager.edit_mode();
}