diff options
| author | Jens Mönig <jens@moenig.org> | 2013-04-18 02:13:35 -0700 |
|---|---|---|
| committer | Jens Mönig <jens@moenig.org> | 2013-04-18 02:13:35 -0700 |
| commit | 5aaba81b0f6474a77d37fedcf863e63762745807 (patch) | |
| tree | c41ba103a2ccfb65b818d46ff241a8304d278a2a | |
| parent | 06d35dae6c6810c3db369b0cf6902c1af3e6f956 (diff) | |
| parent | 285ec99c213f1e031738a9756033dfafa94c5888 (diff) | |
| download | snap-5aaba81b0f6474a77d37fedcf863e63762745807.tar.gz snap-5aaba81b0f6474a77d37fedcf863e63762745807.zip | |
Merge pull request #35 from queryselector/issue-33
Fixed #33
| -rw-r--r-- | blocks.js | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -7735,13 +7735,20 @@ MultiArgMorph.prototype.drawNew = function () { // MultiArgMorph arity control: MultiArgMorph.prototype.addInput = function (contents) { - var newPart = this.labelPart(this.slotSpec), + var i, name, + newPart = this.labelPart(this.slotSpec), idx = this.children.length - 1; // newPart.alpha = this.alpha ? 1 : (1 - this.alpha) / 2; if (contents) { newPart.setContents(contents); } else if (this.elementSpec === '%scriptVars') { - newPart.setContents('abcdefghijklmnopqrstuvwxyz'[idx - 1] || 'foo'); + name = ''; + i = idx; + while (i > 0) { + name = String.fromCharCode(97 + (i - 1) % 26) + name; + i = Math.floor((i - 1) / 26); + } + newPart.setContents(name); } else if (contains(['%parms', '%ringparms'], this.elementSpec)) { newPart.setContents('#' + idx); } |
