Skip to content

Commit

Permalink
Fix incorrect init of $._spritely.instances
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Schuller committed Dec 19, 2013
1 parent 41f6ce0 commit dddbb6b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/jquery.spritely.js
Expand Up @@ -13,6 +13,7 @@
(function($) {
$._spritely = {
// shared methods and variables used by spritely plugin
instances: {},
animate: function(options) {
var el = $(options.el);
var el_id = el.attr('id');
Expand Down Expand Up @@ -254,10 +255,6 @@
background_image = (new Image()),
background_image_src = $._spritely._spStrip($this.css('background-image') || '', 'url("); ');

if (!$._spritely.instances) {
$._spritely.instances = {};
}

if (!$._spritely.instances[el_id]) {
if (options.start_at_frame) {
$._spritely.instances[el_id] = {current_frame: options.start_at_frame - 1};
Expand Down

2 comments on commit dddbb6b

@ironboy
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems this broke the usage of spritely on spritely.net - where the demo no longer works (in Chrome):

Uncaught TypeError: Object [object Object] has no method 'sprite' main.js, line 19

@ironboy
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be wrong here - it might be an incorrect mimetype that broke spritely.net.... (That is trying to load the raw github code...).
Either way I thought you liked to know that spritely.net:s main animation no longer works... :(

Please sign in to comment.