Fix: focus options when activated
This commit is contained in:
parent
b4662f1523
commit
469d6a537a
|
@ -706,13 +706,14 @@ function highlightEditedStyle() {
|
|||
|
||||
|
||||
function embedOptions() {
|
||||
const options = $('#stylus-embedded-options');
|
||||
let options = $('#stylus-embedded-options');
|
||||
if (!options) {
|
||||
const iframe = document.createElement('iframe');
|
||||
iframe.id = 'stylus-embedded-options';
|
||||
iframe.src = '/options.html';
|
||||
document.documentElement.appendChild(iframe);
|
||||
options = document.createElement('iframe');
|
||||
options.id = 'stylus-embedded-options';
|
||||
options.src = '/options.html';
|
||||
document.documentElement.appendChild(options);
|
||||
}
|
||||
options.focus();
|
||||
}
|
||||
|
||||
function unembedOptions() {
|
||||
|
|
|
@ -302,8 +302,3 @@ window.onkeydown = event => {
|
|||
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