fix(android): Cancel works, because lastDetail is now written
It was introduced with two readers and no writer. Cancel called renderDetail(null), which threw on d.rows and did nothing at all - and editDone, which uses it to hand control back after a refusal, was dead the same way. That is why the successive fixes for "Cancel does not respond" changed nothing: they all ended in the same silent throw. Assigned where a detail is drawn, which is the one place that knows it.
This commit is contained in:
@@ -586,9 +586,17 @@ document.getElementById('qx').addEventListener('click', function () {
|
|||||||
var detailRows = [];
|
var detailRows = [];
|
||||||
// Le dernier detail recu, pour redessiner la ligne apres une annulation sans
|
// Le dernier detail recu, pour redessiner la ligne apres une annulation sans
|
||||||
// avoir a le redemander a Delphi.
|
// avoir a le redemander a Delphi.
|
||||||
|
//
|
||||||
|
// IL FAUT L'ECRIRE. Il a ete introduit avec ses deux lecteurs et aucun
|
||||||
|
// ecrivain : Cancel appelait donc renderDetail(null), qui levait sur d.rows et
|
||||||
|
// ne faisait rien du tout. editDone, qui s'en sert aussi pour rendre la main
|
||||||
|
// apres un refus, etait mort de la meme facon - ce qui explique pourquoi les
|
||||||
|
// corrections successives de "Cancel ne repond pas" n'y changeaient rien.
|
||||||
var lastDetail = null;
|
var lastDetail = null;
|
||||||
|
|
||||||
function renderDetail(d) {
|
function renderDetail(d) {
|
||||||
|
if (!d) return;
|
||||||
|
lastDetail = d;
|
||||||
detailRows = d.rows || [];
|
detailRows = d.rows || [];
|
||||||
document.getElementById('dtitle').textContent = d.title || '';
|
document.getElementById('dtitle').textContent = d.title || '';
|
||||||
var html = '', i;
|
var html = '', i;
|
||||||
|
|||||||
Reference in New Issue
Block a user