aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/bootstrap-twipsy.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/js/bootstrap-twipsy.js b/js/bootstrap-twipsy.js
index 7f8ad0fed..e249c815d 100644
--- a/js/bootstrap-twipsy.js
+++ b/js/bootstrap-twipsy.js
@@ -168,10 +168,7 @@
}
, tip: function() {
- if (!this.$tip) {
- this.$tip = $('<div class="twipsy" />').html(this.options.template)
- }
- return this.$tip
+ return this.$tip = this.$tip || $('<div class="twipsy" />').html(this.options.template)
}
, validate: function() {
@@ -194,6 +191,10 @@
this.enabled = !this.enabled
}
+ , toggle: function () {
+ this[this.tip().hasClass('in') ? 'hide' : 'show']()
+ }
+
}