comparison editor.js @ 116:9cf3e0b18ecc

Add support for selecting operator expressions in the editor
author Mike Pavone <pavone@retrodev.com>
date Mon, 15 Apr 2013 21:14:55 -0700
parents f2b435509301
children 0a66fe3a368a
comparison
equal deleted inserted replaced
115:a83989115028 116:9cf3e0b18ecc
48 textContent: this.symbol.name + ' <-' 48 textContent: this.symbol.name + ' <-'
49 }); 49 });
50 this.domNode = base; 50 this.domNode = base;
51 base.appendChild(varName); 51 base.appendChild(varName);
52 node.appendChild(base); 52 node.appendChild(base);
53 console.log(this.expression);
54 this.expression.toHTML(base, this); 53 this.expression.toHTML(base, this);
55 }; 54 };
56 55
57 op.prototype.toHTML = function(node, up) { 56 op.prototype.toHTML = function(node, up) {
58 this.up = up; 57 this.up = up;
58 var astNode = this;
59 var base = newEl('span', { 59 var base = newEl('span', {
60 className: 'op' 60 className: 'op',
61 onclick: function(event) {
62 main_module.opClick(this, astNode, event);
63 }
61 }); 64 });
62 this.domNode = base; 65 this.domNode = base;
63 this.left.toHTML(base, this); 66 this.left.toHTML(base, this);
64 base.appendChild(newEl('span', { 67 base.appendChild(newEl('span', {
65 textContent: this.op, 68 textContent: this.op,