Trying to keep the focus code synced
This commit is contained in:
parent
9ecb9e948f
commit
9ab8d5eb5f
2 changed files with 5 additions and 2 deletions
|
|
@ -1405,7 +1405,7 @@ Computer8080.prototype.getMachineComponent = function(sType, componentPrev)
|
||||||
* where the display is more constrained, so we no longer do it by default (fScroll must be true).
|
* where the display is more constrained, so we no longer do it by default (fScroll must be true).
|
||||||
*
|
*
|
||||||
* @this {Computer8080}
|
* @this {Computer8080}
|
||||||
* @param {boolean} [fScroll]
|
* @param {boolean} [fScroll] (true if you really want the control scrolled into view)
|
||||||
*/
|
*/
|
||||||
Computer8080.prototype.updateFocus = function(fScroll)
|
Computer8080.prototype.updateFocus = function(fScroll)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1432,7 +1432,8 @@ Computer.prototype.getMachineComponent = function(sType, componentPrev)
|
||||||
* updateFocus(fScroll)
|
* updateFocus(fScroll)
|
||||||
*
|
*
|
||||||
* NOTE: When soft keyboard buttons call us to return focus to the machine (and away from the button),
|
* NOTE: When soft keyboard buttons call us to return focus to the machine (and away from the button),
|
||||||
* the scroll feature has annoying effect on iOS, so we no longer do it by default (fScroll must be true).
|
* the browser's default behavior is to scroll the element into view, which can be annoying, especially on iOS,
|
||||||
|
* where the display is more constrained, so we no longer do it by default (fScroll must be true).
|
||||||
*
|
*
|
||||||
* @this {Computer}
|
* @this {Computer}
|
||||||
* @param {boolean} [fScroll] (true if you really want the control scrolled into view)
|
* @param {boolean} [fScroll] (true if you really want the control scrolled into view)
|
||||||
|
|
@ -1450,10 +1451,12 @@ Computer.prototype.updateFocus = function(fScroll)
|
||||||
x = window.scrollX;
|
x = window.scrollX;
|
||||||
y = window.scrollY;
|
y = window.scrollY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO: We need a mechanism to determine the "active" display, instead of hard-coding this to aVideo[0].
|
* TODO: We need a mechanism to determine the "active" display, instead of hard-coding this to aVideo[0].
|
||||||
*/
|
*/
|
||||||
this.aVideo[0].setFocus();
|
this.aVideo[0].setFocus();
|
||||||
|
|
||||||
if (!fScroll && window) {
|
if (!fScroll && window) {
|
||||||
window.scrollTo(x, y);
|
window.scrollTo(x, y);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue