still chasing the discrepency between the imperative edits and the functional ones
This commit is contained in:
parent
26a34ae1fd
commit
a39fb910ce
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
(define (clear-all a-view)
|
(define (clear-all a-view)
|
||||||
(define (loop a-view n)
|
(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
|
(cond
|
||||||
[(view-forward? updated-view)
|
[(view-forward? updated-view)
|
||||||
(loop (view-forward updated-view) (add1 n))]
|
(loop (view-forward updated-view) (add1 n))]
|
||||||
|
|
|
@ -235,6 +235,8 @@
|
||||||
MockView.prototype.updateCss = function(name, value) {
|
MockView.prototype.updateCss = function(name, value) {
|
||||||
return this.act(
|
return this.act(
|
||||||
function(cursor) {
|
function(cursor) {
|
||||||
|
console.log("functionally: ",
|
||||||
|
$(cursor.node[0].cloneNode(false)).css(name, value).get(0));
|
||||||
return cursor.replaceNode([$(cursor.node[0].cloneNode(false))
|
return cursor.replaceNode([$(cursor.node[0].cloneNode(false))
|
||||||
.css(name, value).get(0)]
|
.css(name, value).get(0)]
|
||||||
.concat(cursor.node.slice(1)));
|
.concat(cursor.node.slice(1)));
|
||||||
|
@ -243,6 +245,10 @@
|
||||||
return eventHandlers;
|
return eventHandlers;
|
||||||
},
|
},
|
||||||
function(view) {
|
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);
|
view.focus.css(name, value);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -525,8 +531,6 @@
|
||||||
return this.cursor.node[0].id;
|
return this.cursor.node[0].id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MockView.prototype.isUpMovementOk = function() {
|
MockView.prototype.isUpMovementOk = function() {
|
||||||
return this.cursor.canUp();
|
return this.cursor.canUp();
|
||||||
};
|
};
|
||||||
|
@ -1226,6 +1230,7 @@
|
||||||
// update, and have to do it from scratch.
|
// update, and have to do it from scratch.
|
||||||
var nonce = Math.random();
|
var nonce = Math.random();
|
||||||
var originalMockView = view.getMockAndResetFocus(nonce);
|
var originalMockView = view.getMockAndResetFocus(nonce);
|
||||||
|
console.log("before: ", arrayTreeToDomNode(originalMockView.cursor.node));
|
||||||
toDraw(MACHINE,
|
toDraw(MACHINE,
|
||||||
world,
|
world,
|
||||||
originalMockView,
|
originalMockView,
|
||||||
|
@ -1233,6 +1238,9 @@
|
||||||
if (newMockView.nonce === nonce) {
|
if (newMockView.nonce === nonce) {
|
||||||
var i;
|
var i;
|
||||||
var actions = newMockView.getPendingActions();
|
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++) {
|
for (i = 0; i < actions.length; i++) {
|
||||||
actions[i](view);
|
actions[i](view);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user