From: Jacob Thornton Date: Wed, 5 Oct 2011 05:56:23 +0000 (-0700) Subject: pass more args to placement function X-Git-Tag: v1.4.0~2^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=356227ef506a34f0f5b42076bd776474b3830e9c;p=thirdparty%2Fbootstrap.git pass more args to placement function --- diff --git a/js/bootstrap-twipsy.js b/js/bootstrap-twipsy.js index 0144c48158..97cf47f46b 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 * ======================== */