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

Fix for "All" and "Last" history buttons #89

Merged
merged 5 commits into from Feb 20, 2014
Merged

Fix for "All" and "Last" history buttons #89

merged 5 commits into from Feb 20, 2014

Conversation

SonofNun15
Copy link
Contributor

The history buttons were not working properly. They were referencing a capture variable notices_data, which got out of sync with the global collection of notices because $.merge returns a new instance on each pnotify call. Because of this, the buttons only worked on the first notification opened.

image

Josh Graber added 2 commits January 14, 2014 11:13
…he first notice displayed.

Note that there was a bug in the previous implementation because $.merge() returns a new instance so the captured notices_data variable refers to an array containing only the first opened notification.
…, not only the first notice ever opened. In addition, when using the "push": "top" stack option, the most recent notice is at the opposite end of the array so this should be accounted for.

Note that there was a bug in the previous implementation because $.merge() returns a new instance so the captured notices_data variable refers to an array containing only the first opened notification.

Using the defaults to get the stack value because in theory different notifications could be opened on different stacks, so we have to really on the default to determine if we are pushing to the top.
@hperrin
Copy link
Member

hperrin commented Jan 22, 2014

I don't seem to be having this problem. Which browser are you using to test?

@SonofNun15
Copy link
Contributor Author

I tested this on Chrome, latest version. Steps to reproduce:

  1. Open / display more than 1 notification
  2. Mouse over the chevron-down in the top right corner.
    3a) Select "All"
    4a) Only the first notification ever displayed is shown

3b) Select "Last"
4b) Shows the first notification opened, not the most recent one

@SonofNun15
Copy link
Contributor Author

Clarification: between steps 1 & 2, make sure you manually close or allow all of the notifications to time out. Before proceeding with step 2 no notifications should be displayed.

@SonofNun15
Copy link
Contributor Author

It's possible that this is related to the implementation of $.merge and / or captured variables in different browsers.

@hperrin
Copy link
Member

hperrin commented Jan 22, 2014

That's odd, I'm not seeing the same behavior in Chrome. I don't see how it could hurt though, so I can merge this next time I'm at my computer.

@SonofNun15
Copy link
Contributor Author

Works for me now as well. My installation of chrome seems to have gotten pretty confused / corrupted lately so maybe that was what caused the problem. Only other relevant piece here then is the "push: top" ordering of the open last action.

@hperrin
Copy link
Member

hperrin commented Jan 22, 2014

Oh ok. Awesome. Could you clean up the other parts to only include that? I'll merge it later today then.

@SonofNun15
Copy link
Contributor Author

Sure thing.

Josh Graber added 3 commits January 22, 2014 11:58
…t just the first notice displayed."

This reverts commit 498e448.
…t notice, not only the first notice ever opened. In addition, when using the "push": "top" stack option, the most recent notice is at the opposite end of the array so this should be accounted for."

This reverts commit 32c35e6.
… "top" stack option, the most recent notice is at the opposite end of the array so this should be accounted for.
hperrin added a commit that referenced this pull request Feb 20, 2014
Fix for "All" and "Last" history buttons
@hperrin hperrin merged commit 157999c into sciactive:master Feb 20, 2014
@hperrin
Copy link
Member

hperrin commented Oct 6, 2015

@SonofNun15

I’m writing to you because you’ve contributed to PNotify. As such, you own the copyrights to the code you contributed. I've decided to release PNotify under the Apache License, instead of the current triple license model. This simplifies PNotify's licensing terms, and provides the users of PNotify with more options while using it. It doesn’t remove any of the rights PNotify users have under the current license model.

I need your permission to relicense the code you’ve contributed. Will you please reply to let me know that you agree to have your contributions released under the Apache License?

If you don’t agree, or do not respond before the next release, your contributions may be removed from the code base. Thank you for your help in making PNotify awesome!!

Best,
Hunter Perrin

@SonofNun15 SonofNun15 deleted the fix_history_buttons branch October 6, 2015 21:10
@SonofNun15
Copy link
Contributor Author

@hperrin: I don't have a problem with that. You can include my changes under the new license.

@hperrin
Copy link
Member

hperrin commented Oct 7, 2015

Thanks!

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