]> source.dussan.org Git - archiva.git/commitdiff
oups this event handler is needed for display add form
authorOlivier Lamy <olamy@apache.org>
Thu, 2 Feb 2012 20:43:14 +0000 (20:43 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 2 Feb 2012 20:43:14 +0000 (20:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1239830 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js

index 2a177e195d9d674fd54142486f0fe576b1bc9cd1..75bbcf599091fb5d0e312528512b40421284fe77 100644 (file)
@@ -216,7 +216,19 @@ $(function() {
     window.redbackModel.usersViewModel = new UsersViewModel();
     window.redbackModel.usersViewModel.loadUsers();
     ko.applyBindings(window.redbackModel.usersViewModel,jQuery("#main-content").get(0));
-    $("#main-content #users-view-tabs a:first").tab('show');//
+    $("#main-content #users-view-tabs a:first").tab('show');
+    $("#main-content #users-view-tabs a[data-toggle='tab']").on('show', function (e) {
+      //$.log( $(e.target).attr("href") ); // activated tab
+      //e.relatedTarget // previous tab
+      $.log("tabs shown");
+      if ($(e.target).attr("href")=="#createUserForm") {
+        window.redbackModel.usersViewModel.addUser();
+      }
+      if ($(e.target).attr("href")=="#users-view") {
+        $("#main-content #users-view-tabs-li-user-edit a").html($.i18n.prop("add"));
+      }
+
+    })
     $("#main-content #users-view-tabs-content #users-view").addClass("active");
   }