From 71048b06f8d11332f7db0348a6d6514937b7a823 Mon Sep 17 00:00:00 2001 From: Aaron Snow Date: Sun, 27 Nov 2011 03:32:02 -0500 Subject: [PATCH] Re issue #664, added option "stay" (default = false). When stay = true, the twipsy/popover does not close when the mouse leaves. Coder can then choose how/when to close the twipsy/popover explicitly with twipsy('hide'). --- js/bootstrap-twipsy.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/js/bootstrap-twipsy.js b/js/bootstrap-twipsy.js index 5ebbddd675d2..872b8a1b9b37 100644 --- a/js/bootstrap-twipsy.js +++ b/js/bootstrap-twipsy.js @@ -259,16 +259,18 @@ } function leave() { - var twipsy = get(this) - twipsy.hoverState = 'out' - if (options.delayOut == 0) { - twipsy.hide() - } else { - setTimeout(function() { - if (twipsy.hoverState == 'out') { - twipsy.hide() - } - }, options.delayOut) + if (!options.stay) { + var twipsy = get(this) + twipsy.hoverState = 'out' + if (options.delayOut == 0) { + twipsy.hide() + } else { + setTimeout(function() { + if (twipsy.hoverState == 'out') { + twipsy.hide() + } + }, options.delayOut) + } } } @@ -294,6 +296,7 @@ animate: true , delayIn: 0 , delayOut: 0 + , stay: false , fallback: '' , placement: 'above' , html: false