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

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -