Merge pull request #2344 from bromagosa/dont-focus

kind of a kludge, but it fixes the focus issue with embedded iframes
pull/89/head
Jens Mönig 2019-02-26 10:39:42 +01:00 zatwierdzone przez GitHub
commit 7243ab4e63
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 6 dodań i 11 usunięć

Wyświetl plik

@ -306,13 +306,6 @@ IDE_Morph.prototype.openIn = function (world) {
}
}
// find out whether I'm in embed mode and remember that
// so I don't get focus, because then the iFrame
// involunatarily scrolls into view
if (location.hash.substr(0, 6) === 'embed?') {
this.isEmbedMode = true;
}
this.buildPanes();
world.add(this);
world.userMenu = this.userMenu;
@ -380,6 +373,12 @@ IDE_Morph.prototype.openIn = function (world) {
if (dict.lang) {
myself.setLanguage(dict.lang, null, true); // don't persist
}
// only force my world to get focus if I'm not in embed mode
// to prevent the iFrame from involuntarily scrolling into view
if (!myself.isEmbedMode) {
world.worldCanvas.focus();
}
}
// dynamic notifications from non-source text files
@ -552,10 +551,6 @@ IDE_Morph.prototype.openIn = function (world) {
} else {
interpretUrlAnchors.call(this);
}
if (!this.isEmbedMode) {
world.worldCanvas.focus();
}
};
// IDE_Morph construction