From c7f607eb8ae0c9d92b7bd33804ad4cb3163ef92b Mon Sep 17 00:00:00 2001 From: Quentin Roy Date: Fri, 20 Feb 2015 15:16:19 +0100 Subject: [PATCH] When called with 'letters' as arguments, 'letters' was passed as an argument to the init method which is inconsistant with the other call. Rename the init method to 'letters' and call it with no argument if the method parameter is not provided. --- jquery.lettering.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jquery.lettering.js b/jquery.lettering.js index 70aae46..dbc8af0 100644 --- a/jquery.lettering.js +++ b/jquery.lettering.js @@ -28,7 +28,7 @@ var methods = { - init : function() { + letters : function() { return this.each(function() { injector($(this), '', 'char', ''); @@ -62,8 +62,8 @@ // Method calling logic if ( method && methods[method] ) { return methods[ method ].apply( this, [].slice.call( arguments, 1 )); - } else if ( method === 'letters' || ! method ) { - return methods.init.apply( this, [].slice.call( arguments, 0 ) ); // always pass an array + } else if ( ! method ) { + return methods.letters.apply( this, [].slice.call( arguments, 0 ) ); // always pass an array } $.error( 'Method ' + method + ' does not exist on jQuery.lettering' ); return this;