From 4d70553afa6eabfe0206bc03ffd02cab0adc87eb Mon Sep 17 00:00:00 2001 From: "Frank A. Krueger" Date: Thu, 6 Jul 2017 14:19:06 -0700 Subject: [PATCH] Prevent submits from reloading the page --- Ooui/Client.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Ooui/Client.js b/Ooui/Client.js index 8f554aa..8c37561 100644 --- a/Ooui/Client.js +++ b/Ooui/Client.js @@ -90,7 +90,7 @@ function msgListen (m) { return; } if (debug) console.log ("Listen", node, m.k); - node.addEventListener(m.k, function () { + node.addEventListener(m.k, function (e) { const em = { m: "event", id: m.id, @@ -104,7 +104,8 @@ function msgListen (m) { const ems = JSON.stringify (em); socket.send (ems); if (debug) console.log ("Event", em); - return true; + if (em.k === "submit") + e.preventDefault (); }); }