summaryrefslogtreecommitdiff
path: root/blocks.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-08-01 12:51:04 +0200
committerjmoenig <jens@moenig.org>2013-08-01 12:51:04 +0200
commit060c5fcb9d802f67109c5ef29349a218964c62ef (patch)
treefe30818900a9256006c912c32c8072076ec1d154 /blocks.js
parent8dde1684f146457b9b6dd054f2e1a99a3d59cce7 (diff)
downloadsnap-byow-060c5fcb9d802f67109c5ef29349a218964c62ef.tar.gz
snap-byow-060c5fcb9d802f67109c5ef29349a218964c62ef.zip
Italicize editable input options (e.g. for the SPLT block)
Diffstat (limited to 'blocks.js')
-rw-r--r--blocks.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/blocks.js b/blocks.js
index 74c3574..eedf9a5 100644
--- a/blocks.js
+++ b/blocks.js
@@ -6097,7 +6097,9 @@ InputSlotMorph.prototype.setContents = function (aStringOrFloat) {
isConstant = dta instanceof Array;
if (isConstant) {
dta = localize(dta[0]);
+ cnts.isItalic = !this.isReadOnly;
} else { // assume dta is a localizable choice if it's a key in my choices
+ cnts.isItalic = false;
if (this.choices !== null && this.choices[dta] instanceof Array) {
return this.setContents(this.choices[dta]);
}
@@ -6535,7 +6537,13 @@ InputSlotMorph.prototype.mouseClickLeft = function (pos) {
};
InputSlotMorph.prototype.reactToKeystroke = function () {
- this.constant = null;
+ var cnts;
+ if (this.constant) {
+ cnts = this.contents();
+ this.constant = null;
+ cnts.isItalic = false;
+ cnts.drawNew();
+ }
};
InputSlotMorph.prototype.reactToEdit = function () {