Fix: focus options when activated
This commit is contained in:
parent
b4662f1523
commit
469d6a537a
|
@ -706,13 +706,14 @@ function highlightEditedStyle() {
|
||||||
|
|
||||||
|
|
||||||
function embedOptions() {
|
function embedOptions() {
|
||||||
const options = $('#stylus-embedded-options');
|
let options = $('#stylus-embedded-options');
|
||||||
if (!options) {
|
if (!options) {
|
||||||
const iframe = document.createElement('iframe');
|
options = document.createElement('iframe');
|
||||||
iframe.id = 'stylus-embedded-options';
|
options.id = 'stylus-embedded-options';
|
||||||
iframe.src = '/options.html';
|
options.src = '/options.html';
|
||||||
document.documentElement.appendChild(iframe);
|
document.documentElement.appendChild(options);
|
||||||
}
|
}
|
||||||
|
options.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function unembedOptions() {
|
function unembedOptions() {
|
||||||
|
|
|
@ -302,8 +302,3 @@ window.onkeydown = event => {
|
||||||
top.dispatchEvent(new CustomEvent('closeOptions'));
|
top.dispatchEvent(new CustomEvent('closeOptions'));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// FF is slow to allow focus, particularly when launched via manager button
|
|
||||||
setTimeout(() => {
|
|
||||||
window.focus();
|
|
||||||
}, 100);
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user