summaryrefslogtreecommitdiff
path: root/widgets.js
diff options
context:
space:
mode:
authorGubolin <gubolin@fantasymail.de>2015-03-24 18:29:54 +0100
committerGubolin <gubolin@fantasymail.de>2015-03-24 18:29:54 +0100
commitbdd780e0030507626c947f85880a9eaa36e24194 (patch)
tree070a36fee08b43b5e231b2a1e8e5fe28314a7cb8 /widgets.js
parentc8de6a00e38e52bfc4b9b3a095cbcad1861687de (diff)
parent457224dd620eea4f20f24ebc62391363333cd00f (diff)
downloadsnap-bdd780e0030507626c947f85880a9eaa36e24194.tar.gz
snap-bdd780e0030507626c947f85880a9eaa36e24194.zip
merge branch OOP
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..b52782b 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-March-21';
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);
}
};