commit 7bd7330afaf05a3ff535dbf0437d6f3ae321373a
parent 2e4b1eb7a968833300b8a582835ef97ff11e82c4
Author: Marcello Stanisci <marcello.stanisci@inria.fr>
Date: Tue, 20 Oct 2015 20:49:40 +0200
allowing the button to get uncolored
Diffstat:
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/frontend/checkout.php b/src/frontend/checkout.php
@@ -153,7 +153,6 @@ function has_taler_wallet_cb(aEvent)
};
-
/* Function called when the Taler extension was unloaded,
here we disable the option */
function taler_wallet_unload_cb(aEvent)
@@ -181,6 +180,15 @@ test_without_wallet();
// first event
document.body.addEventListener("taler-wallet-mfirst", has_taler_wallet_cb, false);
+// The following callback is used to allow the button to change its
+// color whenever the user navigates away from this page
+document.body.addEventListener("taler-shutdown",
+ function(){
+ var unloadEvent = new Event('taler-unload');
+ document.body.dispatchEvent(unloadEvent);
+ },
+ false);
+
// event awaited by the wallet to change its button's color
// alert("sending");
// var eve = new Event('taler-payment-mfirst');