diff --git a/www/poll/test/main.js b/www/poll/test/main.js index 615d19e72..cf2132478 100644 --- a/www/poll/test/main.js +++ b/www/poll/test/main.js @@ -51,9 +51,13 @@ define([ var type = input.type.toLowerCase(); var id = getRealtimeId(input); + console.log(input); + switch (type) { case 'text': console.log("text[rt-id='%s'] [%s]", id, input.value); + + if (!input.value) { return void console.log("Hit enter?"); } Render.setValue(APP.proxy, id, input.value); break; case 'checkbox': @@ -85,10 +89,14 @@ define([ } }; - var handleClick = function (e) { + var handleClick = function (e, isKeyup) { if (!APP.ready) { return; } var target = e && e.target; + if (isKeyup) { + console.log("Keyup!"); + } + if (!target) { return void console.log("NO TARGET"); } var nodeName = target && target.nodeName; @@ -145,6 +153,8 @@ define([ var $table = APP.$table = $(Render.asHTML(proxy)); var $createRow = APP.$createRow = $('#create-option').click(function () { + // + console.error("BUTTON CLICKED! LOL"); Render.createRow(proxy, function () { change(); }); @@ -160,7 +170,7 @@ define([ $table .click(handleClick) - .on('keyup', handleClick); + .on('keyup', function (e) { handleClick(e, true); }); proxy .on('change', [], change) diff --git a/www/poll/test/render.js b/www/poll/test/render.js index 53c2589a9..fde96c54c 100644 --- a/www/poll/test/render.js +++ b/www/poll/test/render.js @@ -114,6 +114,7 @@ by maintaining indexes in rowsOrder and colsOrder }; var createRow = Render.createRow = function (obj, cb, id, value) { + console.error('new row!'); var order = Cryptpad.find(obj, ['table', 'rowsOrder']); if (!order) { throw new Error("Uninitialized realtime object!"); } id = id || rowuid();