diff --git a/.gitignore b/.gitignore index 746b3d7..2e8f5a9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ videos/* node_modules/* css/main.css -build/* \ No newline at end of file +build/* +.idea/* \ No newline at end of file diff --git a/src/valiant.jquery.js b/src/valiant.jquery.js index baaaeff..6740519 100644 --- a/src/valiant.jquery.js +++ b/src/valiant.jquery.js @@ -507,6 +507,8 @@ three.js r65 or higher }; $.fn[pluginName] = function ( options ) { + // use pluginArguments instead of this.each arguments, otherwise Valiant360('loadVideo', 'path/to/video') path argument will be missing + var pluginArguments = arguments; return this.each(function () { if(typeof options === 'object' || !options) { // A really lightweight plugin wrapper around the constructor, @@ -516,8 +518,8 @@ three.js r65 or higher $.data(this, "plugin_" + pluginName, this.plugin); } } else if(this.plugin[options]) { - // Allows plugin methods to be called - return this.plugin[options].apply(this.plugin, Array.prototype.slice.call(arguments, 1)) + // Allows plugin methods to be called - use pluginArguments instead of this.each arguments + return this.plugin[options].apply(this.plugin, Array.prototype.slice.call(pluginArguments, 1)) } }); };