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

allow calling IC.processNodes() #20

Closed
niv opened this issue Jun 28, 2014 · 1 comment
Closed

allow calling IC.processNodes() #20

niv opened this issue Jun 28, 2014 · 1 comment

Comments

@niv
Copy link
Contributor

niv commented Jun 28, 2014

I've added this to the returned object by intercooler.js:

processNodes: function(elt) {
  return processNodes(elt);
},

Reason being is, I'm using intercooler as an enhancement to pjax to load (rails) partials. At some point I might move completely to IC, since it's pretty cool, but for now this "workaround" is needed. Since I upgraded to IC 0.4.0 just now and lost my patch, I thought I'd open this feature request to have this added by default.

I'm calling it from the pjax success hook

$('#pjax-container').on 'pjax:success', ->
  Intercooler.processNodes("#pjax-container")

so that intercooler attribs are parsed correctly. I think it'd be useful to expose this by default, since I can't be the only one that wants to parse arbitary html nodes for IC stuff and insert it into the DOM.

@1cg
Copy link
Contributor

1cg commented Jul 1, 2014

Looks reasonable to me. You mind generating a pull request and I'll include it in the next release (a few weeks or so)?

Thanks!

1cg pushed a commit that referenced this issue Jul 4, 2014
expose Intercooler.processNodes(e) (PR for #20)

Thanks!
@1cg 1cg closed this as completed Jul 10, 2014
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