How to DRY coffeescript -
how 1 adhere dry in case (the number of accordions large):
$ -> $("#accordion-1").accordion autoheight: false navigation: true $ -> $("#accordion-2").accordion autoheight: false navigation: true
it seems can create function generate function selector:
create = (selector) -> $ -> $(selector).accordion autoheight: false navigation: true
then:
create "#accordion1" create "#accordion2"
Comments
Post a Comment