From 060c5fcb9d802f67109c5ef29349a218964c62ef Mon Sep 17 00:00:00 2001 From: jmoenig Date: Thu, 1 Aug 2013 12:51:04 +0200 Subject: Italicize editable input options (e.g. for the SPLT block) --- blocks.js | 10 +++++++++- history.txt | 3 ++- 2 files changed, 11 insertions(+), 2 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 () { diff --git a/history.txt b/history.txt index 5fd3680..6b1f1ae 100755 --- a/history.txt +++ b/history.txt @@ -1836,4 +1836,5 @@ ______ 130801 ------ -* Blocks, Threads: "whitespace" & other options in SPLIT reporter's dropdown +* Blocks, Threads: "whitespace" & other options in SPLIT reporter's dropdown +* Blocks: Italicize editable input options (e.g. for the SPLT block) -- cgit v1.3.1