summaryrefslogtreecommitdiffstats
path: root/packages/meteor-useraccounts-core/lib/templates_helpers/at_nav_button.js
blob: c434060d684a651bb451abe80c7168f035ee367f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
AT.prototype.atNavButtonHelpers = {
    text: function(){
        var key = Meteor.userId() ? AccountsTemplates.texts.navSignOut : AccountsTemplates.texts.navSignIn;
        return T9n.get(key, markIfMissing=false);
    }
};

AT.prototype.atNavButtonEvents = {
    'click #at-nav-button': function(event){
        event.preventDefault();
        if (Meteor.userId())
            AccountsTemplates.logout();
        else
            AccountsTemplates.linkClick("signIn");
    },
};