# HG changeset patch # User Mike Pavone # Date 1375763918 25200 # Node ID 1157639353e773de034f5624d39e0dd21450262b # Parent da7f585bf6260c8ba927c3c84bc7047c35275d8e Add dummy handler for clicking a symbol while a lambda is selected. Fix the code for selecting the first inner node of an object literal. diff -r da7f585bf626 -r 1157639353e7 src/editor.tp --- a/src/editor.tp Mon Aug 05 21:34:50 2013 -0700 +++ b/src/editor.tp Mon Aug 05 21:38:38 2013 -0700 @@ -230,8 +230,7 @@ lambdaClick <- :domnode astnode event { selectNode: domnode popInscope: ((astnode symbols) allSymbols: (foreign: undefined)) onClick: :key { - domnode textContent!: key - astnode name!: key + console log: "foooobar!" } inner <- if: ((astnode args) length) > 0 { (astnode args) getEl: 0 @@ -247,6 +246,7 @@ popInscope: ((astnode symbols) allSymbols: (foreign: undefined)) onClick: :key { console log: "fooobar!" } + setSelection: astnode withInNode: ((astnode messages) getEl: 0) event stopPropagation: (foreign: undefined) } @@ -292,7 +292,7 @@ } } } - + //bind handlers for editor buttons each: (qall: ".controls li") :idx el { el onclick!: :event { @@ -306,21 +306,21 @@ (q: "#lit_button") onclick!: :event { showLit } - + (q: "#in") onclick!: :event { console log: "inwards" if: (selection valid?) { selection in } } - + (q: "#out") onclick!: :event { console log: "outwards" if: (selection valid?) { selection out } } - + path <- (window location) pathname if: (path indexOf: "/edit/") = 0 { editFile: (path substr: 5)