kopia lustrzana https://github.com/backface/turtlestitch
enable Symbols in InputField drop down menus
rodzic
a151f64a89
commit
a810667d8d
|
@ -1974,3 +1974,4 @@ ______
|
||||||
* Blocks: enable Costumes as Symbols and Symbols as custom block label parts
|
* Blocks: enable Costumes as Symbols and Symbols as custom block label parts
|
||||||
* BYOB: Symbol selection menu for BlockLabelFragmentMorphs
|
* BYOB: Symbol selection menu for BlockLabelFragmentMorphs
|
||||||
* Portuguese translation update
|
* Portuguese translation update
|
||||||
|
* Widgets: enable Symbols in InputField drop down menus
|
||||||
|
|
20
widgets.js
20
widgets.js
|
@ -74,7 +74,7 @@ HTMLCanvasElement, fontHeight, SymbolMorph, localize, SpeechBubbleMorph,
|
||||||
ArrowMorph, MenuMorph, isString, isNil, SliderMorph, MorphicPreferences,
|
ArrowMorph, MenuMorph, isString, isNil, SliderMorph, MorphicPreferences,
|
||||||
ScrollFrameMorph*/
|
ScrollFrameMorph*/
|
||||||
|
|
||||||
modules.widgets = '2013-July-04';
|
modules.widgets = '2013-October-25';
|
||||||
|
|
||||||
var PushButtonMorph;
|
var PushButtonMorph;
|
||||||
var ToggleButtonMorph;
|
var ToggleButtonMorph;
|
||||||
|
@ -2965,12 +2965,18 @@ InputFieldMorph.prototype.dropDownMenu = function () {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
menu.addItem(' ', null);
|
menu.addItem(' ', null);
|
||||||
for (key in choices) {
|
if (choices instanceof Array) {
|
||||||
if (Object.prototype.hasOwnProperty.call(choices, key)) {
|
choices.forEach(function (choice) {
|
||||||
if (key[0] === '~') {
|
menu.addItem(choice[0], choice[1]);
|
||||||
menu.addLine();
|
});
|
||||||
} else {
|
} else { // assuming a dictionary
|
||||||
menu.addItem(key, choices[key]);
|
for (key in choices) {
|
||||||
|
if (Object.prototype.hasOwnProperty.call(choices, key)) {
|
||||||
|
if (key[0] === '~') {
|
||||||
|
menu.addLine();
|
||||||
|
} else {
|
||||||
|
menu.addItem(key, choices[key]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue