summaryrefslogtreecommitdiff
path: root/blocks.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2014-06-06 13:57:45 +0200
committerjmoenig <jens@moenig.org>2014-06-06 13:57:45 +0200
commit7f8d5a3d1eacdc78f61da8e82ac481bbbb825938 (patch)
tree2589fd29d40516c3a5c171a5aca6fcff80b7cff9 /blocks.js
parenta5eace927aae19f8141eb525a72b18b757f57261 (diff)
downloadsnap-yow-7f8d5a3d1eacdc78f61da8e82ac481bbbb825938.tar.gz
snap-yow-7f8d5a3d1eacdc78f61da8e82ac481bbbb825938.zip
relabelling custom blocks (experimental)
Diffstat (limited to 'blocks.js')
-rw-r--r--blocks.js9
1 files changed, 9 insertions, 0 deletions
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(