]> source.dussan.org Git - archiva.git/commitdiff
logout must reload screen to take care of no more karma
authorOlivier Lamy <olamy@apache.org>
Thu, 6 Sep 2012 14:21:22 +0000 (14:21 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 6 Sep 2012 14:21:22 +0000 (14:21 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1381617 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/menu.html

index c0db5b811731af0cc3f0ff94736a8298df9a607d..74840a9449de28067428686636b00639920340c7 100644 (file)
@@ -44,11 +44,22 @@ function(jquery,ui,sammy,tmpl) {
     $("#register-link").show();
     $("#logout-link").hide();
     $("#change-password-link").hide();
+    // cleanup karmas
+    window.redbackModel.operatioNames=[];
     hideElementWithKarma();
-    if (doScreenChange) screenChange();
+    if (doScreenChange) {
+      screenChange();
+    }
     $("#main-content").html("");
     $.ajax({
-      url: 'restServices/redbackServices/loginService/logout'
+      url: 'restServices/redbackServices/loginService/logout',
+      complete: function(){
+        if(!doScreenChange){
+          // refresh the screen as no more karmas now
+          window.sammyArchivaApplication.refresh();
+        }
+      }
+
     });
   };
 
index f0ee15a674fd55d20d028b8ca9e20cf4b3e8acbf..35e44a8909ab0c5eb087a0259a12f2599debd3e3 100644 (file)
@@ -79,7 +79,7 @@
               </a>
             </li>
             <li id="logout-link" style="display: none">
-              <a onclick="logout(true);" id="logout-link-a">
+              <a onclick="logout(false);" id="logout-link-a">
                 <span class="btn btn-danger label force-upper-case">${$.i18n.prop('logout')}</span>
               </a>
             </li>