Fixed issue #3983: Return focus to Not trusted notification when modal is closed (#4745)

* Resolvedg merge conflicts

* removed strig comparison

* #3983 Removed unnecessary lines

* Add if statement to focus button
pull/4764/head
Babatunde Adeola 7 years ago committed by Thomas Kluyver
parent 3e2ee045d4
commit 59619978b9

@ -131,6 +131,9 @@ define(['jquery',
options.keyboard_manager.enable();
options.keyboard_manager.command_mode();
}
if (options.focus_button) {
$(options.focus_button).focus();
}
});
if (options.keyboard_manager) {

@ -2973,7 +2973,7 @@ define([
/**
* Explicitly trust the output of this notebook.
*/
Notebook.prototype.trust_notebook = function () {
Notebook.prototype.trust_notebook = function (from_notification) {
var body = $("<div>").append($("<p>")
.text(i18n.msg._("A trusted Jupyter notebook may execute hidden malicious code when you open it. " +
"Selecting trust will immediately reload this notebook in a trusted state. " +
@ -2989,6 +2989,7 @@ define([
keyboard_manager: this.keyboard_manager,
title: i18n.msg._("Trust this notebook?"),
body: body,
focus_button: from_notification,
buttons: {
Cancel : {},

@ -402,7 +402,7 @@ define([
$(tnw.selector).css('cursor', 'help');
} else {
tnw.set_message(i18n.msg._("Not Trusted"), undefined, function() {
that.notebook.trust_notebook();
that.notebook.trust_notebook("#notification_trusted");
return false;
}, {'title':'Javascript disabled for notebook display'});
$(tnw.selector).attr('role', 'button');

Loading…
Cancel
Save