Skip to content

Commit

Permalink
still chasing the discrepency between the imperative edits and the fu…
Browse files Browse the repository at this point in the history
…nctional ones
  • Loading branch information
Danny Yoo committed Sep 12, 2011
1 parent 26a34ae commit a39fb91
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web-world/examples/forward-backward/forward-backward.rkt
Expand Up @@ -19,7 +19,7 @@

(define (clear-all a-view)
(define (loop a-view n)
(define updated-view (update-view-css a-view "border" "none"))
(define updated-view a-view) ;; (update-view-css a-view "border" "none"))
(cond
[(view-forward? updated-view)
(loop (view-forward updated-view) (add1 n))]
Expand Down
12 changes: 10 additions & 2 deletions web-world/js-impl.js
Expand Up @@ -235,6 +235,8 @@
MockView.prototype.updateCss = function(name, value) {
return this.act(
function(cursor) {
console.log("functionally: ",
$(cursor.node[0].cloneNode(false)).css(name, value).get(0));
return cursor.replaceNode([$(cursor.node[0].cloneNode(false))
.css(name, value).get(0)]
.concat(cursor.node.slice(1)));
Expand All @@ -243,6 +245,10 @@
return eventHandlers;
},
function(view) {
if (view.focus.length === 0) {
console.log('update css: empty focus?!');
}
console.log('css: updating:\n', view.focus);
view.focus.css(name, value);
});
};
Expand Down Expand Up @@ -525,8 +531,6 @@
return this.cursor.node[0].id;
};



MockView.prototype.isUpMovementOk = function() {
return this.cursor.canUp();
};
Expand Down Expand Up @@ -1226,13 +1230,17 @@
// update, and have to do it from scratch.
var nonce = Math.random();
var originalMockView = view.getMockAndResetFocus(nonce);
console.log("before: ", arrayTreeToDomNode(originalMockView.cursor.node));
toDraw(MACHINE,
world,
originalMockView,
function(newMockView) {
if (newMockView.nonce === nonce) {
var i;
var actions = newMockView.getPendingActions();
console.log("this should match:",
view.focus.clone(true).get(0));
console.log("actions", actions.length);
for (i = 0; i < actions.length; i++) {
actions[i](view);
}
Expand Down

0 comments on commit a39fb91

Please sign in to comment.