kopia lustrzana https://github.com/backface/turtlestitch
Merge pull request #2344 from bromagosa/dont-focus
kind of a kludge, but it fixes the focus issue with embedded iframespull/89/head
commit
7243ab4e63
17
src/gui.js
17
src/gui.js
|
@ -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();
|
this.buildPanes();
|
||||||
world.add(this);
|
world.add(this);
|
||||||
world.userMenu = this.userMenu;
|
world.userMenu = this.userMenu;
|
||||||
|
@ -380,6 +373,12 @@ IDE_Morph.prototype.openIn = function (world) {
|
||||||
if (dict.lang) {
|
if (dict.lang) {
|
||||||
myself.setLanguage(dict.lang, null, true); // don't persist
|
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
|
// dynamic notifications from non-source text files
|
||||||
|
@ -552,10 +551,6 @@ IDE_Morph.prototype.openIn = function (world) {
|
||||||
} else {
|
} else {
|
||||||
interpretUrlAnchors.call(this);
|
interpretUrlAnchors.call(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.isEmbedMode) {
|
|
||||||
world.worldCanvas.focus();
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// IDE_Morph construction
|
// IDE_Morph construction
|
||||||
|
|
Ładowanie…
Reference in New Issue