getting rid of the copying debug message
This commit is contained in:
parent
d6fb2ff295
commit
d80d7bdb3a
|
@ -4,21 +4,39 @@
|
||||||
|
|
||||||
(define base-view (->view index.html))
|
(define base-view (->view index.html))
|
||||||
|
|
||||||
|
(define (remove-all x elts)
|
||||||
|
(cond
|
||||||
|
[(empty? elts)
|
||||||
|
empty]
|
||||||
|
[(equal? x (first elts))
|
||||||
|
(remove-all x (rest elts))]
|
||||||
|
[else
|
||||||
|
(cons (first elts)
|
||||||
|
(remove-all x (rest elts)))]))
|
||||||
|
|
||||||
(define view-with-buttons
|
(define view-with-buttons
|
||||||
(foldl (lambda (name a-view)
|
(foldl (lambda (name a-view)
|
||||||
(view-bind (view-focus a-view name)
|
(view-bind (view-focus a-view name)
|
||||||
"click"
|
"click"
|
||||||
(lambda (world a-view)
|
(lambda (world a-view)
|
||||||
(begin
|
(cond
|
||||||
(printf "here: ~s\n" (view-attr
|
[(view-has-attr? a-view "checked")
|
||||||
a-view
|
(cons name world)]
|
||||||
"checked"))
|
[else
|
||||||
world))))
|
(remove-all name world)]))))
|
||||||
base-view
|
base-view
|
||||||
'("hot" "cross" "buns")))
|
'("hot" "cross" "buns")))
|
||||||
|
|
||||||
|
(define view-with-buttons-and-reset
|
||||||
|
(view-bind (view-focus view-with-buttons "reset")
|
||||||
|
"click"
|
||||||
|
(lambda (world a-view)
|
||||||
|
empty)))
|
||||||
|
|
||||||
|
|
||||||
(define (draw w v)
|
(define (draw w v)
|
||||||
v)
|
(update-view-text (view-focus v "mydiv")
|
||||||
|
(format "~s" w)))
|
||||||
|
|
||||||
(big-bang '()
|
(big-bang '()
|
||||||
(initial-view view-with-buttons)
|
(initial-view view-with-buttons)
|
||||||
|
|
|
@ -48,7 +48,6 @@
|
||||||
// copy over the attributes as well
|
// copy over the attributes as well
|
||||||
if (node.attributes) {
|
if (node.attributes) {
|
||||||
for (i = 0; i < node.attributes.length; i++) {
|
for (i = 0; i < node.attributes.length; i++) {
|
||||||
console.log('copying: ', node.attributes[i]);
|
|
||||||
$(result).attr(node.attributes[i].name,
|
$(result).attr(node.attributes[i].name,
|
||||||
node.attributes[i].value);
|
node.attributes[i].value);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user