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

"Don't show again" button #19

Open
Maidomax opened this issue Dec 22, 2014 · 2 comments
Open

"Don't show again" button #19

Maidomax opened this issue Dec 22, 2014 · 2 comments

Comments

@Maidomax
Copy link

This is either a feature request or a request for assistance.
I'm trying to add a "Don't show again" button to individual tooltips that would prevent them from being shown in the future. I tried to accomplish this by by adding an <input type="checkbox" name="tour_tooltip_1" id="tour_tooltip_1" ng-model="tooltip_1_dismissed"> to the text of each tooltip, and the checkbox renders correctly, but doesn't have access to any scopes, including $rootScope. The model doesn't get bound to anything, I can't output any values with (( myValue }} inside the tooltip. The tooltip content seems completely outside of my Angular app's scope.
Is there any way I can accomplish what I need done?

Thanks!

@afloyd
Copy link

afloyd commented Apr 2, 2015

👍

@afloyd
Copy link

afloyd commented Apr 7, 2015

I didn't do a "full" implementation as it should be... But I forked the code and added a disable checkbox to the modals.

When instantiating the ng-joyride directive you should put a dont-show-fn attribute (ie <ng-joyride dont-show-fn="myFunc()" />) in there that references a function you want to run when the checkbox is checked and the user clicks skip or finish while on the joyride.

In my case I added a "hideJoyride" value to my user object and my dontShowFn then sets that value to true so on future visits I never enable the joyride...

A possible enhancement to what I did is if a dontShowFn is not passed in, and they click the disabled checkbox then it will update a browser cookie to not show on future visits. Hope it helps someone else looking for this.

I didn't issue a pull request since it's not fully implemented for all use cases, and you cannot selectively show/hide the checkbox through configuration. But hopefully it helps someone else that needs this

Cheers,
Austin

https://github.com/afloyd/ng-joyride
through bower use:
"ng-joyride-af": "0.1.12"

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

No branches or pull requests

3 participants