From 7f8d5a3d1eacdc78f61da8e82ac481bbbb825938 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Fri, 6 Jun 2014 13:57:45 +0200 Subject: relabelling custom blocks (experimental) --- blocks.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'blocks.js') diff --git a/blocks.js b/blocks.js index af5542f..159d1a2 100644 --- a/blocks.js +++ b/blocks.js @@ -2009,6 +2009,7 @@ BlockMorph.prototype.userMenu = function () { var menu = new MenuMorph(this), world = this.world(), myself = this, + alternatives, blck; menu.addItem( @@ -2066,6 +2067,14 @@ BlockMorph.prototype.userMenu = function () { ); } ); + } else if (this.definition && this.alternatives) { // custom block + alternatives = this.alternatives(); + if (alternatives.length > 0) { + menu.addItem( + 'relabel...', + function () {myself.relabel(alternatives); } + ); + } } menu.addItem( -- cgit v1.3.1