Skip to content

Loading…

Swiff Can use String.generateUID() #26

Closed
wants to merge 1 commit into from

3 participants

@arian
MooTools member

No description provided.

@subtleGradient
MooTools member

Let's not mess around with adding unnecessary dependencies to something that is going to be leaving Core soon anyway.

Do not want.

@cpojer
MooTools member

Yeah, let's ignore this one

@arian
MooTools member

oki

@subtleGradient
MooTools member
@arian
MooTools member

It turns out that the id variable was already used in the initialize method, so when creating more instances of Swiff the id variable became NaN and stopped working, see ticket #1040

https://mootools.lighthouseapp.com/projects/2706/tickets/1040

Since String.generateUID has been changed in just String.uniqueID() I recommitted this:

http://github.com/arian/mootools-core/commit/4c4aabdfe6f6178b2d7789516cbdbb966296fdf3

@arian
MooTools member

See line: http://github.com/mootools/mootools-core/blob/master/Source/Utilities/Swiff.js#L53

We can rename the variable to sid or something, but just using String.uniqueID is just as easy and it doesn't come with extra dependencies since String.uniqueID is in Core.js

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 11, 2010
  1. @arian
Showing with 1 addition and 3 deletions.
  1. +1 −3 Source/Utilities/Swiff.js
View
4 Source/Utilities/Swiff.js
@@ -19,8 +19,6 @@ provides: Swiff
(function(){
-var id = 0;
-
var Swiff = this.Swiff = new Class({
Implements: Options,
@@ -46,7 +44,7 @@ var Swiff = this.Swiff = new Class({
},
initialize: function(path, options){
- this.instance = 'Swiff_' + id++;
+ this.instance = 'Swiff_' + String.generateUID();
this.setOptions(options);
options = this.options;
Something went wrong with that request. Please try again.