]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
pass more args to placement function
authorJacob Thornton <jacobthornton@gmail.com>
Wed, 5 Oct 2011 05:56:23 +0000 (22:56 -0700)
committerJacob Thornton <jacobthornton@gmail.com>
Wed, 5 Oct 2011 05:56:23 +0000 (22:56 -0700)
js/bootstrap-twipsy.js

index 0144c48158ae764c837e93f333bbed46601856b2..97cf47f46b89d22b3c8fd7ce911bd15f8fd25bfd 100644 (file)
@@ -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':
  /* 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
   * ======================== */