Mercurial > repos > tabletprog
diff editor.js @ 119:77f7cd65e121
Add selection of number and string literals. Support inward navigation of lambdas.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Wed, 17 Apr 2013 00:23:05 -0700 |
parents | 0a66fe3a368a |
children | d5dc9507d612 |
line wrap: on
line diff
--- a/editor.js Mon Apr 15 21:55:26 2013 -0700 +++ b/editor.js Wed Apr 17 00:23:05 2013 -0700 @@ -83,28 +83,40 @@ intlit.prototype.toHTML = function(node, up) { this.up = up; + var astNode = this; this.domNode = newEl('span', { className: 'integer', - textContent: this.val + textContent: this.val, + onclick: function(event) { + main_module.scalarClick(this, astNode, event); + } }); node.appendChild(this.domNode); }; floatlit.prototype.toHTML = function(node, up) { this.up = up; + var astNode = this; this.domNode = newEl('span', { className: 'float', - textContent: this.val + textContent: this.val, + onclick: function(event) { + main_module.scalarClick(this, astNode, event); + } }); node.appendChild(this.domNode); }; strlit.prototype.toHTML = function(node, up) { this.up = up; + var astNode = this; this.domNode = newEl('span', { className: 'string', contentEditable: 'true', - textContent: this.val + textContent: this.val, + onclick: function(event) { + main_module.scalarClick(this, astNode, event); + } }); node.appendChild(this.domNode); };