aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Thornton <[email protected]>2011-10-04 22:56:23 -0700
committerJacob Thornton <[email protected]>2011-10-04 22:56:23 -0700
commit356227ef506a34f0f5b42076bd776474b3830e9c (patch)
treeedc87800948cbdcb4a5562f0149b56c64b46cfde
parenta2c263493a7b6ca1933778feada80bab38c78581 (diff)
downloadbootstrap-356227ef506a34f0f5b42076bd776474b3830e9c.tar.xz
bootstrap-356227ef506a34f0f5b42076bd776474b3830e9c.zip
pass more args to placement function
-rw-r--r--js/bootstrap-twipsy.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/js/bootstrap-twipsy.js b/js/bootstrap-twipsy.js
index 0144c4815..97cf47f46 100644
--- a/js/bootstrap-twipsy.js
+++ b/js/bootstrap-twipsy.js
@@ -90,7 +90,8 @@
actualWidth = $tip[0].offsetWidth
actualHeight = $tip[0].offsetHeight
- placement = _.maybeCall(this.options.placement, this.$element[0])
+
+ placement = maybeCall(this.options.placement, this, [ $tip[0], this.$element[0] ])
switch (placement) {
case 'below':
@@ -193,15 +194,10 @@
/* TWIPSY PRIVATE METHODS
* ====================== */
- var _ = {
-
- maybeCall: function ( thing, ctx ) {
- return (typeof thing == 'function') ? (thing.call(ctx)) : thing
- }
-
+ function maybeCall ( thing, ctx, args ) {
+ return typeof thing == 'function' ? thing.apply(ctx, args) : thing
}
-
/* TWIPSY PLUGIN DEFINITION
* ======================== */