diff options
| author | jmoenig <jens@moenig.org> | 2013-10-25 15:12:27 +0200 |
|---|---|---|
| committer | jmoenig <jens@moenig.org> | 2013-10-25 15:12:27 +0200 |
| commit | a810667d8d70186da7a045611de0f999937bb7a9 (patch) | |
| tree | bf372fbad1d362faaf44840ea76d51d3c564ddea | |
| parent | a151f64a8978b8771d521e9840ce646630cf1595 (diff) | |
| download | snap-byow-a810667d8d70186da7a045611de0f999937bb7a9.tar.gz snap-byow-a810667d8d70186da7a045611de0f999937bb7a9.zip | |
enable Symbols in InputField drop down menus
| -rwxr-xr-x | history.txt | 1 | ||||
| -rw-r--r-- | widgets.js | 20 |
2 files changed, 14 insertions, 7 deletions
diff --git a/history.txt b/history.txt index 36a7273..a157723 100755 --- a/history.txt +++ b/history.txt @@ -1974,3 +1974,4 @@ ______ * Blocks: enable Costumes as Symbols and Symbols as custom block label parts * BYOB: Symbol selection menu for BlockLabelFragmentMorphs * Portuguese translation update +* Widgets: enable Symbols in InputField drop down menus @@ -74,7 +74,7 @@ HTMLCanvasElement, fontHeight, SymbolMorph, localize, SpeechBubbleMorph, ArrowMorph, MenuMorph, isString, isNil, SliderMorph, MorphicPreferences, ScrollFrameMorph*/ -modules.widgets = '2013-July-04'; +modules.widgets = '2013-October-25'; var PushButtonMorph; var ToggleButtonMorph; @@ -2965,12 +2965,18 @@ InputFieldMorph.prototype.dropDownMenu = function () { return null; } menu.addItem(' ', null); - for (key in choices) { - if (Object.prototype.hasOwnProperty.call(choices, key)) { - if (key[0] === '~') { - menu.addLine(); - } else { - menu.addItem(key, choices[key]); + if (choices instanceof Array) { + choices.forEach(function (choice) { + menu.addItem(choice[0], choice[1]); + }); + } else { // assuming a dictionary + for (key in choices) { + if (Object.prototype.hasOwnProperty.call(choices, key)) { + if (key[0] === '~') { + menu.addLine(); + } else { + menu.addItem(key, choices[key]); + } } } } |
