This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/signup-cta.js.es6
2015-10-30 14:13:16 -04:00

27 lines
688 B
JavaScript

export default Ember.Component.extend({
action: "showCreateAccount",
actions: {
neverShow() {
this.keyValueStore.setItem('anon-cta-never', 't');
this.session.set('showSignupCta', false);
},
hideForSession() {
this.session.set('hideSignupCta', true);
this.keyValueStore.setItem('anon-cta-hidden', new Date().getTime());
Em.run.later(() =>
this.session.set('showSignupCta', false),
20 * 1000);
},
showCreateAccount() {
this.sendAction();
}
},
_turnOffIfHidden: function() {
if (this.session.get('hideSignupCta')) {
this.session.set('showSignupCta', false);
}
}.on('willDestroyElement')
});