diff options
author | Olivier Lamy <olamy@apache.org> | 2013-07-25 11:58:22 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2013-07-25 11:58:22 +0000 |
commit | 45b05c75a64da2bdbde7424739364d49b2d955ef (patch) | |
tree | 73670ada4682bd89d85951d83dc4186c5ff3e8de /archiva-modules/archiva-web | |
parent | 29850b7e49bc838c708fd4d8210b1b6191ede0dd (diff) | |
download | archiva-45b05c75a64da2bdbde7424739364d49b2d955ef.tar.gz archiva-45b05c75a64da2bdbde7424739364d49b2d955ef.zip |
fix issue with users page
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1506917 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-web')
3 files changed, 8 insertions, 5 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/utils.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/utils.js index 6bca0fdbf..7c0db1ce4 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/utils.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/archiva/utils.js @@ -128,7 +128,7 @@ require(["jquery","jquery.tmpl","i18n","knockout"], function(jquery,jqueryTmpl,i var mainContent=$("#main-content"); mainContent.empty(); mainContent.removeAttr("data-bind"); - $("#body_content" ).find(".popover" ).hide(); + $("#body_content").find(".popover" ).hide(); clearUserMessages(); if(window.archivaModel.adminExists==false){ displayErrorMessage($.i18n.prop("admin.creation.mandatory")); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/knockout-2.3.0.debug.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/knockout-2.3.0.debug.js index 1888c274e..61a93db07 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/knockout-2.3.0.debug.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/knockout-2.3.0.debug.js @@ -2099,7 +2099,8 @@ ko.exportSymbol('bindingProvider', ko.bindingProvider); var alreadyBound = ko.utils.domData.get(node, boundElementDomDataKey); if (!bindings) { if (alreadyBound) { - throw Error("You cannot apply bindings multiple times to the same element."); + // prevent issue with #users + //throw Error("You cannot apply bindings multiple times to the same element."); } ko.utils.domData.set(node, boundElementDomDataKey, true); } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js index d3df7fb8e..18c9dafb0 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js @@ -315,7 +315,7 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid) { screenChange(); var mainContent = $("#main-content"); mainContent.html(mediumSpinnerImg()); - mainContent.attr("data-bind",'template: {name:"usersGrid"}'); + $.ajax("restServices/redbackServices/userService/getUsers", { type: "GET", @@ -327,7 +327,10 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid) { var usersViewModel = new UsersViewModel(); usersViewModel.users(mappedUsers); usersViewModel.originalUsers(mappedUsers); - ko.applyBindings(usersViewModel,jQuery("#main-content").get(0)); + mainContent.attr("data-bind",'template: {name:"usersGrid"}'); + $.log("before applyBindings"); + ko.applyBindings(usersViewModel,mainContent.get(0));//mainContent.find("#usersTable" ).get(0));// + $.log("first applyBindings"); mainContent.find("#users-view-tabs a:first").tab('show'); mainContent.find("#users-view-tabs a[data-toggle='tab']").on('show', function (e) { if ($(e.target).attr("href")=="#createUserForm") { @@ -336,7 +339,6 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid) { if ($(e.target).attr("href")=="#users-view") { mainContent.find("#users-view-tabs-li-user-edit a").html($.i18n.prop("add")); } - }) mainContent.find("#users-view-tabs-content #users-view").addClass("active"); applyAutocompleteOnHeaders(usersViewModel); |