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 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)

@ -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();

Loading…
Cancel
Save