Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANIJS not working with widgets #54

Closed
crashnick16 opened this issue Jan 31, 2015 · 7 comments
Closed

ANIJS not working with widgets #54

crashnick16 opened this issue Jan 31, 2015 · 7 comments

Comments

@crashnick16
Copy link

Hi,

i am trying to use ANIJS to animate add/remove of the widgets in the grid but for some reason this would not work. is there any event that gets triggered on add/remove?

the syntax is data-anijs="if: <event_name>, do: animated bounceIn"

thanks,
Nick

@troolee
Copy link
Member

troolee commented Feb 2, 2015

I will try to implement support of anijs

@radiolips
Copy link
Member

@troolee Nothing special should be required to support anijs. By emitting an event for adding a widget and another for removing it, @crashnick16 should be able to get it working.

@troolee
Copy link
Member

troolee commented Feb 20, 2016

it could be some issues with animations delay. Needs to be checked

radiolips added a commit to radiolips/gridstack.js that referenced this issue Feb 23, 2016
@radiolips
Copy link
Member

gridstack will now emit added and removed. I've successfully run a test. AniJS requires custom code be written for custom events, so I quickly wrote something up that worked okay:

                AniJS.run();
                self.gridstackNotifier = AniJS.getNotifier('gridstack');
                $('.grid-stack').on('removed', function(event, items) {
                    self.gridstackNotifier.dispatchEvent('removed');
                });

and the data-ani-js:
data-anijs="if: removed, do: swing animated, on: $gridstack"

This will swing animated when a widget is removed. By changing removed to added, it'll fire on widgets added. Let me know if you need further help!

@troolee
Copy link
Member

troolee commented Feb 23, 2016

@radiolips, could you please make a note about AniJS support in README.md?

@radiolips
Copy link
Member

Absolutely! I'm putting a demo together currently.

@AK1979
Copy link

AK1979 commented Mar 16, 2017

Hi
I'm trying to add animation when the widget is closed but the 'removed' event is fired when the widget is not on the DOM.

Can you please attach working example of the removed animation ?

Regards,
Arie.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants