Fixed the Computer updateFocus() interface to keep the page stable unless fScroll is explicitly set

This commit is contained in:
Jeff Parsons 2016-08-23 14:59:06 -07:00
commit 2b24e710d2
5 changed files with 385 additions and 379 deletions

View file

@ -506,10 +506,15 @@ CPU8080.prototype.setBinding = function(sHTMLType, sBinding, control, sValue)
this.bindings[sBinding] = control;
control.onclick = function onClickRun() {
if (!cpu.cmp || !cpu.cmp.checkPower()) return;
/*
* We no longer pass true to these runCPU()/stopCPU() calls, on the theory that if the "run"
* control is visible, then the computer is probably sufficiently visible as well; the problem
* with setting fUpdateFocus to true is that it can jerk the web page around in annoying ways.
*/
if (!cpu.flags.fRunning)
cpu.runCPU(true);
cpu.runCPU();
else
cpu.stopCPU(true);
cpu.stopCPU();
};
fBound = true;
break;