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

How to add state (class and pseudo-class) to markup.example ? #22

Open
ethyde opened this issue Apr 21, 2014 · 1 comment
Open

How to add state (class and pseudo-class) to markup.example ? #22

ethyde opened this issue Apr 21, 2014 · 1 comment

Comments

@ethyde
Copy link

ethyde commented Apr 21, 2014

I think with custom parser for markup and template ? But after some research and testing I have not found a good solution ...

Thanks for any help :)

edit and it's probably a side effect of #15 ?

@dwarcher
Copy link

I did it with a small template change and some jquery. Not perfect, but easy and better than nothing:

{{#state}}
<div class="example state">
  <div class="name">{{name}}</div>
  <div class="item" data-state="{{escaped}}">
    {{{../markup.example}}}
  </div>
</div>
{{/state}}




$(function() {
  $("div.example.state > div.item").each(function() {
    var pseudoState = $(this).attr("data-state");
    $(this).children().addClass(pseudoState);
  })
});

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

No branches or pull requests

2 participants