Jump to content
Search Community

Is Draggable missing a dependency on CSSPlugin ?

andynormancx test
Moderator Tag

Go to solution Solved by GreenSock,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I'm having fun getting Draggable and TweenMax working with RequireJS (as part of a Durandal project).

 

I think there might be a bug in Draggable, it looks to me like it is missing a dependency definition for CSSPlugin. The define for it looks like this:

_gsScope._gsDefine("utils.Draggable", ["events.EventDispatcher","TweenLite"], function(EventDispatcher, TweenLite) {
On line 1757 CSSPlugin gets referenced as a global object:
setRatio:(_isOldIE ? function() { TweenLite.set(target, tempVars); } : CSSPlugin._internals.setTransformRatio || CSSPlugin._internals.set3DTransformRatio)
This line fails with an exception when I am loading Draggable via RequireJS. I have fixed it by changing the define call to:
_gsScope._gsDefine("utils.Draggable", ["events.EventDispatcher","TweenLite", "plugins.CSSPlugin"], function(EventDispatcher, TweenLite, CSSPlugin) {

Does this look like a valid fix or am I missing some other reason why this call to CSSPlugin as a global object should be like it is ?

 

  • Like 1
Link to comment
Share on other sites

My environment is still "in the browser" by the way, just using Durandal (including RequireJS) and dependency injection, the objects aren't in the global namespace.

 

Getting everything working with RequireJS has been a challenge, but I think I am finally there.

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

Ah yes, I see what you mean - this isn't a problem in the browser since CSSPlugin is a global, but in your environment it's trickier. Yes, I'll make that change that you suggested; thanks for identifying a solution. nice work :)

 

I think this is a problem in the browser if you are setting GreenSockGlobals; then CSSPlugin ends up not being in the global space and we get the same issue. At least, that's my situation; and applying andynormancx's patch has fixed the problem.

Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...