Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
videos/*
node_modules/*
css/main.css
build/*
build/*
.idea/*
6 changes: 4 additions & 2 deletions src/valiant.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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))
}
});
};
Expand Down