Mercurial > repos > tabletprog
diff editor.js @ 29:18cec540238a
Prevent event bubbling so lambda click handler doesn't get called when clicking on an element inside it
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 05 Apr 2012 21:06:43 -0700 |
parents | 93bbc4c8be95 |
children | 648659961e0e |
line wrap: on
line diff
--- a/editor.js Thu Apr 05 19:06:10 2012 -0700 +++ b/editor.js Thu Apr 05 21:06:43 2012 -0700 @@ -14,8 +14,8 @@ var astNode = this; var el = newEl('div', { className: 'lambda', - onclick: function() { - return mainModule.lambdaClick(this, astNode); + onclick: function(event) { + mainModule.lambdaClick(this, astNode, event); } }); var args = newEl('div', { @@ -96,8 +96,8 @@ base.appendChild(newEl('span', { textContent: parts[i] + (this.receiver && parts.length == 1 ? '' : ':'), className: 'funpart', - onclick: function() { - return mainModule.funClick(this, astNode); + onclick: function(event) { + mainModule.funClick(this, astNode, event); }})); if (this.args[i]) { this.args[i].toHTML(base); @@ -115,8 +115,8 @@ node.appendChild(newEl('span', { className: 'symbol', textContent: this.name, - onclick: function() { - return mainModule.symbolClick(this, astNode); + onclick: function(event) { + mainModule.symbolClick(this, astNode, event); } })); }