diff options
Diffstat (limited to 'widgets.js')
| -rw-r--r-- | widgets.js | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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); } }; |
