still chasing bug
This commit is contained in:
parent
a1660fb5cb
commit
26a34ae1fd
|
@ -11,26 +11,35 @@
|
||||||
(define (go-backward world dom)
|
(define (go-backward world dom)
|
||||||
(max (sub1 world) 0))
|
(max (sub1 world) 0))
|
||||||
|
|
||||||
|
(define (view-top a-view)
|
||||||
|
(if (view-up? a-view)
|
||||||
|
(view-top (view-up a-view))
|
||||||
|
a-view))
|
||||||
|
|
||||||
|
|
||||||
(define (clear-all a-view)
|
(define (clear-all a-view)
|
||||||
(define updated-view (update-view-css a-view "border" "none"))
|
(define (loop a-view n)
|
||||||
(cond
|
(define updated-view (update-view-css a-view "border" "none"))
|
||||||
[(view-forward? updated-view)
|
(cond
|
||||||
(clear-all (view-forward updated-view))]
|
[(view-forward? updated-view)
|
||||||
[else
|
(loop (view-forward updated-view) (add1 n))]
|
||||||
updated-view]))
|
[else
|
||||||
|
(view-top updated-view)]))
|
||||||
|
(loop a-view 0))
|
||||||
|
|
||||||
(define (iterate n f x)
|
(define (iterate n f x)
|
||||||
(if (<= n 0)
|
(if (<= n 0)
|
||||||
x
|
x
|
||||||
(iterate (sub1 n ) f (f x))))
|
(iterate (sub1 n) f (f x))))
|
||||||
|
|
||||||
(define (draw world dom)
|
(define (draw world dom)
|
||||||
(update-view-css (iterate world
|
(define another-view (update-view-css (iterate world
|
||||||
view-forward
|
view-forward
|
||||||
(clear-all dom))
|
(clear-all dom))
|
||||||
"border"
|
"border"
|
||||||
"1px solid blue"))
|
"1px solid blue"))
|
||||||
|
another-view)
|
||||||
|
|
||||||
|
|
||||||
(define my-initial-view (view-bind
|
(define my-initial-view (view-bind
|
||||||
(view-focus
|
(view-focus
|
||||||
|
|
|
@ -340,7 +340,7 @@
|
||||||
} else if (view.focus.next().length > 0) {
|
} else if (view.focus.next().length > 0) {
|
||||||
view.focus = view.focus.next();
|
view.focus = view.focus.next();
|
||||||
} else {
|
} else {
|
||||||
while (true) {
|
while (view.focus.get(0) !== view.top.get(0)) {
|
||||||
view.focus = view.focus.parent();
|
view.focus = view.focus.parent();
|
||||||
if (view.focus.next().length > 0) {
|
if (view.focus.next().length > 0) {
|
||||||
view.focus = view.focus.next();
|
view.focus = view.focus.next();
|
||||||
|
@ -349,7 +349,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
MockView.prototype.backward = function() {
|
MockView.prototype.backward = function() {
|
||||||
return this.act(
|
return this.act(
|
||||||
|
@ -593,7 +593,6 @@
|
||||||
|
|
||||||
View.prototype.getMockAndResetFocus = function(nonce) {
|
View.prototype.getMockAndResetFocus = function(nonce) {
|
||||||
this.focus = this.top;
|
this.focus = this.top;
|
||||||
|
|
||||||
return new MockView(domToArrayTreeCursor($(this.top).get(0)),
|
return new MockView(domToArrayTreeCursor($(this.top).get(0)),
|
||||||
EMPTY_PENDING_ACTIONS,
|
EMPTY_PENDING_ACTIONS,
|
||||||
this.eventHandlers.slice(0),
|
this.eventHandlers.slice(0),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user