Mercurial > repos > tabletprog
diff src/editor.tp @ 124:1157639353e7
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.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 05 Aug 2013 21:38:38 -0700 |
parents | d5dc9507d612 |
children | 2b25d0ce2946 |
line wrap: on
line diff
--- 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)