oups this event handler is needed for display add form

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1239830 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-02-02 20:43:14 +00:00
parent de91fd4a50
commit 1a1b76592b
1 changed files with 13 additions and 1 deletions

View 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");
}