Share Posted March 31, 2015 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 ? 1 Link to comment Share on other sites More sharing options...
Share Posted April 2, 2015 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 3 Link to comment Share on other sites More sharing options...
Author Share Posted April 2, 2015 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. 1 Link to comment Share on other sites More sharing options...
Share Posted September 2, 2015 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 More sharing options...
Share Posted January 13, 2016 Hello,Using Draggable I am getting the same message in the console; GSAP encountered missing dependency: com.greensock.plugins.CSSPlugin Even with the changes that @andynormancx suggested (I'm using the latest version) it's still in the console.Thanks! Link to comment Share on other sites More sharing options...
Share Posted January 13, 2016 Can you please provide a reduced test case in codepen or jsfiddle or something? It sounds like you're forgetting to load CSSPlugin which is a dependency for Draggable. Or you can just load TweenMax and Draggable because TweenMax has CSSPlugin inside of it. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now