From 284da6a4e9bb0c807473d8a434462e4eaf8a9a1a Mon Sep 17 00:00:00 2001 From: ansuz Date: Wed, 13 Apr 2016 10:16:44 +0200 Subject: [PATCH] minor improvements I made to the /hack/ pad last night --- www/hack/main.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/www/hack/main.js b/www/hack/main.js index f5618c8b3..b775b73dc 100644 --- a/www/hack/main.js +++ b/www/hack/main.js @@ -58,7 +58,7 @@ define([ window.alert("Server Connection Lost"); }; - var rt = Realtime.start(config); + var rt = window.rt = Realtime.start(config); var cursor = Cursor($textarea[0]); @@ -114,13 +114,20 @@ define([ } } + // simulate a keypress so the event goes through.. // prevent default behaviour for tab e.preventDefault(); + rt.bumpSharejs(); + break; default: break; } }); + $textarea.on('change', function () { + rt.bumpSharejs(); + }); + $run.click(function (e) { e.preventDefault(); var content = $textarea.val();