couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From millayr <...@git.apache.org>
Subject [GitHub] couchdb-fauxton pull request #883: Navbar refactor
Date Tue, 28 Mar 2017 18:25:29 GMT
Github user millayr commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/883#discussion_r108499424
  
    --- Diff: app/addons/auth/base.js ---
    @@ -19,58 +19,46 @@ Auth.session = new Auth.Session();
     FauxtonAPI.setSession(Auth.session);
     app.session = Auth.session;
     
    -Auth.initialize = function () {
     
    -  FauxtonAPI.addHeaderLink({
    -    id: 'auth',
    -    title: 'Login',
    -    href: '#/login',
    -    icon: 'fonticon-user',
    -    bottomNav: true
    -  });
    +function cleanupAuthSection () {
    +  FauxtonAPI.removeHeaderLink({ id: 'auth', bottomNav: true });
    +}
    +
    +Auth.initialize = function () {
     
       Auth.session.on('change', function () {
    -    var session = Auth.session;
    -    var link = {};
    +    const session = Auth.session;
     
         if (session.isAdminParty()) {
    -      link = {
    +      const link = {
             id: 'auth',
             title: 'Admin Party!',
             href: '#/createAdmin',
             icon: 'fonticon-user',
             bottomNav: true
           };
    +
    +      cleanupAuthSection();
    +      FauxtonAPI.addHeaderLink(link);
    +      FauxtonAPI.hideLogin();
    +
         } else if (session.isLoggedIn()) {
    -      link = {
    +      const link = {
    --- End diff --
    
    fixed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message