From: Olivier Lamy Date: Thu, 2 Feb 2012 20:43:14 +0000 (+0000) Subject: oups this event handler is needed for display add form X-Git-Tag: archiva-1.4-M3~1395 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1a1b76592b77ffde4a2340a5f53711a91ce5672d;p=archiva.git 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 --- diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js index 2a177e195..75bbcf599 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/users.js @@ -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"); }