summaryrefslogtreecommitdiff
path: root/widgets.js
diff options
context:
space:
mode:
Diffstat (limited to 'widgets.js')
-rw-r--r--widgets.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/widgets.js b/widgets.js
index bb250a8..57e0697 100644
--- a/widgets.js
+++ b/widgets.js
@@ -7,7 +7,7 @@
written by Jens Mönig
jens@moenig.org
- Copyright (C) 2014 by Jens Mönig
+ Copyright (C) 2015 by Jens Mönig
This file is part of Snap!.
@@ -74,7 +74,7 @@ HTMLCanvasElement, fontHeight, SymbolMorph, localize, SpeechBubbleMorph,
ArrowMorph, MenuMorph, isString, isNil, SliderMorph, MorphicPreferences,
ScrollFrameMorph*/
-modules.widgets = '2014-February-13';
+modules.widgets = '2015-June-25';
var PushButtonMorph;
var ToggleButtonMorph;
@@ -493,7 +493,7 @@ function ToggleButtonMorph(
labelString,
query, // predicate/selector
environment,
- hint,
+ hint, // optional, String or Function
template, // optional, for cached background images
minWidth, // <num> optional, if specified label will left-align
hasPreview, // <bool> show press color on left edge (e.g. category)
@@ -560,12 +560,13 @@ ToggleButtonMorph.prototype.init = function (
// ToggleButtonMorph events
ToggleButtonMorph.prototype.mouseEnter = function () {
+ var contents = this.hint instanceof Function ? this.hint() : this.hint;
if (!this.state) {
this.image = this.highlightImage;
this.changed();
}
- if (this.hint) {
- this.bubbleHelp(this.hint);
+ if (contents) {
+ this.bubbleHelp(contents);
}
};