Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember Collapsible Container

I'm using Ember.js with handlebars and I need to make a div within my page collapse/expand when clicked. I know how to do this in jQuery, but I can't use any jQuery. Does anyone know how to accomplish this? Also I don't want to just toggle a hide attribute, I need the full sliding up and down feature for collapsing. If anyone has any ideas, I'd really appreciate it.

Thanks

like image 601
Hoopdady Avatar asked Sep 09 '26 21:09

Hoopdady


1 Answers

Clicking on your view will cause a click event to be triggered. You can code your animation in any manner you want inside a click event handler in your view:

CollapsableView = Ember.View.extend({
   click : function(event) {
      this.$().toggle('fast');
   }
})
like image 98
buuda Avatar answered Sep 11 '26 10:09

buuda