Skip to content

Commit 0970c1b

Browse files
committed
support simple method calls
1 parent 04d4a12 commit 0970c1b

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

dist/jquery.payform.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ payform = require('./payform');
1919
return payform.numericInput(this.get(0));
2020
}
2121
};
22-
return $.fn.payform = function() {
23-
var args, method;
24-
args = [].slice.call(arguments);
25-
method = args.shift();
26-
$.payform.fn[method].apply(this, args);
22+
return $.fn.payform = function(method) {
23+
if ($.payform.fn[method] != null) {
24+
$.payform.fn[method].call(this);
25+
}
2726
return this;
2827
};
2928
})(jQuery);

dist/jquery.payform.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/jquery.payform.coffee

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ do ($ = jQuery) ->
1313
formatNumeric: ->
1414
payform.numericInput @get(0)
1515

16-
$.fn.payform = ->
17-
args = [].slice.call(arguments)
18-
method = args.shift()
19-
$.payform.fn[method].apply(this, args)
16+
$.fn.payform = (method) ->
17+
$.payform.fn[method].call(this) if $.payform.fn[method]?
2018
return this

0 commit comments

Comments
 (0)