aboutsummaryrefslogtreecommitdiff
path: root/js/tooltip.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tooltip.js')
-rw-r--r--js/tooltip.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/js/tooltip.js b/js/tooltip.js
index b2d775938..2d42cab24 100644
--- a/js/tooltip.js
+++ b/js/tooltip.js
@@ -404,7 +404,13 @@
}
Tooltip.prototype.tip = function () {
- return (this.$tip = this.$tip || $(this.options.template))
+ if (!this.$tip) {
+ this.$tip = $(this.options.template)
+ if (this.$tip.length != 1) {
+ throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!')
+ }
+ }
+ return this.$tip
}
Tooltip.prototype.arrow = function () {