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

Add header to materials collection React component #272

Merged
merged 2 commits into from Oct 27, 2016

Conversation

pjanik
Copy link
Member

@pjanik pjanik commented Oct 21, 2016

Adds optional header to materials collection component. It will be rendered only if the number of materials in collection is > 0.

@emcelroy, you would need to modify calls to renderMaterialsCollection:

 Portal.renderMaterialsCollection(13, '#collection-1', {limit: 10, header: 'Why do fishermen need forests?'}); 

and remove static headers defined in HTML. Header will be rendered as H1 element with class collection-header, so it can be additionally styled on the home page.

@scytacki
Copy link
Member

@pjanik will you be able to add the callback to this today or tomorrow?

@pjanik
Copy link
Member Author

pjanik commented Oct 26, 2016

@scytacki, sorry, I forgot about it. Yes, I can do it for sure.

@pjanik
Copy link
Member Author

pjanik commented Oct 26, 2016

Done, example:

 Portal.renderMaterialsCollection(13, '#collection-1', {
  limit: 10, 
  onDataLoad: function (materials) {
    console.log('downloaded ' + materials.length + ' materials');
  },
  header: 'Test header'
}); 

@scytacki
Copy link
Member

👍

@scytacki scytacki merged commit 6ba3b0b into master Oct 27, 2016
@scytacki scytacki deleted the materials-collection-header branch October 27, 2016 19:49
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

Successfully merging this pull request may close these issues.

None yet

2 participants