lundi 27 juillet 2015

How to trigger JQuery action without breaking separation of concerns

I use SemanticUI and Ember and I would like to make a some content disappear with a transition when clicking a button.

The way to do this with SemanticUI is $('#id').transition('type-of-transition'). Knowing that the controller should not be aware of the view (so I can't use this selector as an action of the controller), and <script> tag does not seem to be the Ember way of doing it, how can I do?

I tried to create a component that has a "transition" action, and to use it like

{{#transition-component shouldHide=shouldHide}}
<!-- Here comes what I want to make disappear -->
{{/transition-component}}

But after hiding, the composent gets refreshed and shows up back.




Aucun commentaire:

Enregistrer un commentaire