Skip to content
This repository has been archived by the owner on Jun 19, 2018. It is now read-only.

Configurable Event Count Badge #55

Closed
nbering opened this issue Apr 7, 2015 · 7 comments
Closed

Configurable Event Count Badge #55

nbering opened this issue Apr 7, 2015 · 7 comments

Comments

@nbering
Copy link
Contributor

nbering commented Apr 7, 2015

I have mixed feelings about the new event count badges. I generally like the idea, but in my use case it can be a big confusing. My calendar presents a list of time slots, some empty and some filled. Displaying the number in the way that this feature does is confusing for my users, and empty timeslots are included in this count. See the attached screenshot:

screenshot 2015-04-07 15 39 54

I would propose that you have at minimum an option to turn this feature off completely. Even better would be to also have a property of events that would not count that particular event in this count. Kind of an ignore flag or something.

@mattlewis92
Copy link
Owner

Every element in the calendar purposefully has classes set in the HTML. So you can hide it like so:

.cal-events-num {
    display: none;
}

I can make the event types configurable easily enough as well.

@simpixelated
Copy link
Contributor

👍 for configurable even types

@nbering
Copy link
Contributor Author

nbering commented Apr 8, 2015

I'm working on a pull-request for this feature. It will add a property to the event to determine whether it should be counted for the badge. I would just like to hear other's opinions of what to call this property.

I think of a badge like that as bringing attention to a new event, or calling it out as a reminder. In that light it could be called isNew, isReminder, etc.

You could also think of it as a property to hide something that is there by default in which case the property name could be something like hide, hideCount, hideNotification, noCount, etc. If I were just writing this for my own use case it would probably be something like isEmpty, as my calendar shows time slots that have yet to be filled.

@mattlewis92
Copy link
Owner

How about incrementsBadgeTotal?

@nbering
Copy link
Contributor Author

nbering commented Apr 9, 2015

I'll give that a try, and should have something to show by the weekend.

@nbering
Copy link
Contributor Author

nbering commented Apr 9, 2015

Yup. That's pretty much exactly what I was going to write. Thanks!

@nbering
Copy link
Contributor Author

nbering commented Apr 10, 2015

I had a chance to test this out and found one small problem. The ng-show on the badge is tied to events.day.length, causing a badge with a zero to be displayed if none of the events increment the badge count.

I would usually do something like ng-show="countEvents(day.events)>0", but this might not be so simple with a filter. I think you'd need to expose the filter on $scope, but I've never tried this before.

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

No branches or pull requests

3 participants