changeset 28:93bbc4c8be95

Allow selection of lambda
author Mike Pavone <pavone@retrodev.com>
date Thu, 05 Apr 2012 19:06:10 -0700
parents ae913b642040
children 18cec540238a
files editor.css editor.js editor.tp
diffstat 3 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/editor.css	Thu Apr 05 07:59:29 2012 -0700
+++ b/editor.css	Thu Apr 05 19:06:10 2012 -0700
@@ -42,7 +42,7 @@
 	background-color: yellow;
 }
 
-#src span.selected
+#src .selected
 {
 	background-color: yellow;
 }
@@ -127,6 +127,11 @@
 	display: inline-block;
 }
 
+#src div
+{
+	background-color: inherit;
+}
+
 .object
 {
 	display: inline;
@@ -172,6 +177,7 @@
 	display: block;
 	content: '}';
 	margin-left: -2em;
+	background-color: inherit;
 }
 
 .funcall > .funcall, .assignment > .funcall
--- a/editor.js	Thu Apr 05 07:59:29 2012 -0700
+++ b/editor.js	Thu Apr 05 19:06:10 2012 -0700
@@ -11,8 +11,12 @@
 };
 
 lambda.prototype.toHTML = function(node) {
+	var astNode = this;
 	var el = newEl('div', {
-		className: 'lambda'
+		className: 'lambda',
+		onclick: function() {
+			return mainModule.lambdaClick(this, astNode);
+		}
 	});
 	var args = newEl('div', {
 		className: 'args'
--- a/editor.tp	Thu Apr 05 07:59:29 2012 -0700
+++ b/editor.tp	Thu Apr 05 19:06:10 2012 -0700
@@ -117,6 +117,10 @@
 	popInscope: syms
 }
 
+lambdaClick <- :domnode astnode {
+	symbolClick: domnode astnode
+}
+
 main <- {
 	//bind handlers for file browser links
 	each: (qall: "a") :idx el {