Permalink
Browse files

pass more args to placement function

  • Loading branch information...
1 parent a2c2634 commit 356227ef506a34f0f5b42076bd776474b3830e9c @fat fat committed Oct 5, 2011
Showing with 4 additions and 8 deletions.
  1. +4 −8 js/bootstrap-twipsy.js
View
@@ -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
* ======================== */

0 comments on commit 356227e

Please sign in to comment.