most recent work

pull/1/head
ansuz 8 years ago
parent e5ff7020fb
commit 4a4d4a0474

@ -51,9 +51,13 @@ define([
var type = input.type.toLowerCase(); var type = input.type.toLowerCase();
var id = getRealtimeId(input); var id = getRealtimeId(input);
console.log(input);
switch (type) { switch (type) {
case 'text': case 'text':
console.log("text[rt-id='%s'] [%s]", id, input.value); 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); Render.setValue(APP.proxy, id, input.value);
break; break;
case 'checkbox': case 'checkbox':
@ -85,10 +89,14 @@ define([
} }
}; };
var handleClick = function (e) { var handleClick = function (e, isKeyup) {
if (!APP.ready) { return; } if (!APP.ready) { return; }
var target = e && e.target; var target = e && e.target;
if (isKeyup) {
console.log("Keyup!");
}
if (!target) { return void console.log("NO TARGET"); } if (!target) { return void console.log("NO TARGET"); }
var nodeName = target && target.nodeName; var nodeName = target && target.nodeName;
@ -145,6 +153,8 @@ define([
var $table = APP.$table = $(Render.asHTML(proxy)); var $table = APP.$table = $(Render.asHTML(proxy));
var $createRow = APP.$createRow = $('#create-option').click(function () { var $createRow = APP.$createRow = $('#create-option').click(function () {
//
console.error("BUTTON CLICKED! LOL");
Render.createRow(proxy, function () { Render.createRow(proxy, function () {
change(); change();
}); });
@ -160,7 +170,7 @@ define([
$table $table
.click(handleClick) .click(handleClick)
.on('keyup', handleClick); .on('keyup', function (e) { handleClick(e, true); });
proxy proxy
.on('change', [], change) .on('change', [], change)

@ -114,6 +114,7 @@ by maintaining indexes in rowsOrder and colsOrder
}; };
var createRow = Render.createRow = function (obj, cb, id, value) { var createRow = Render.createRow = function (obj, cb, id, value) {
console.error('new row!');
var order = Cryptpad.find(obj, ['table', 'rowsOrder']); var order = Cryptpad.find(obj, ['table', 'rowsOrder']);
if (!order) { throw new Error("Uninitialized realtime object!"); } if (!order) { throw new Error("Uninitialized realtime object!"); }
id = id || rowuid(); id = id || rowuid();

Loading…
Cancel
Save