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

New feature (for developers?): Update header with optional information #442

Closed
Jopyth opened this issue Sep 16, 2016 · 10 comments
Closed

New feature (for developers?): Update header with optional information #442

Jopyth opened this issue Sep 16, 2016 · 10 comments

Comments

@Jopyth
Copy link
Contributor

Jopyth commented Sep 16, 2016

I like headers for my modules, but at the same time they need additional space. Therefore I think it is useful to be able to add tiny bits of information to the header, which otherwise would need extra space in the module content.

An implementation example exists on my fork. I could create a clean pull request, with only the modifications regarding this appendix to the header (open for other name suggestions ;) ).

For example we can show, when the last data was pulled in the backend, or how many contacts from the address book have been loaded, small hints if an error occurs, etc.

Examples

Maybe related losely to #236.

@MichMich
Copy link
Collaborator

Yeah, this is something on my wishlist/todo list. Will probably add this feature next month.

@MichMich
Copy link
Collaborator

Of course a PR is welcome, but it depends on the implementation. I'm a little picky for the core changes.

@Jopyth
Copy link
Contributor Author

Jopyth commented Sep 17, 2016

Well then start picking on #444 when you have time. Or you can just use this as a basis for your ideas.

@MichMich
Copy link
Collaborator

I've added this functionality. See: b2a7d35

Example code:

getHeader: function() {
    return this.data.header + ' appendix';
}

Let me know if this works for you.

@Jopyth
Copy link
Contributor Author

Jopyth commented Sep 20, 2016

Actually, I think we want a div instead of a header element. Is there a reason to make the header an actual header element?

I think if we have a header element, we can not easily include icons for example.

@Jopyth
Copy link
Contributor Author

Jopyth commented Sep 20, 2016

Example:

getHeader: function() {
    return this.data.header + ' <span class="fa fa-refresh"></span> ' + this.lastUpdated;
}

This one did not work for me inside a header element. However it worked inside a div.

Although I am wondering why this post, says that for example span elements should work. Maybe there was a different error. Can you confirm, that it is possible to include a font-awesome icon in the header? That would be awesome.

@MichMich
Copy link
Collaborator

Not sure. It should return a string. What error do you experience?

@MichMich
Copy link
Collaborator

If this really is an issue, I wouldn't mind moving to a dig container in stead of a header. Feel free to send a PR for this. Otherwise I can make an adjustment somewhere later this week.

@Jopyth
Copy link
Contributor Author

Jopyth commented Sep 21, 2016

Never mind, my bad. I guess there must have been some other error. The span tag works just fine inside the header tag.

When I originally implemented this, it appeared as if it did not resolve the html span tag correctly (displaying the raw code instead of the font awesome symbol). But it works perfectly fine now.

@MichMich
Copy link
Collaborator

Good to hear. Looking forward to your module and see how you implemented it.

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