From c4ea53e70eacca452c60b5515ea55c0364fdfea2 Mon Sep 17 00:00:00 2001 From: gschwab Date: Fri, 14 Mar 2014 09:37:30 +0100 Subject: [PATCH] fixed index problem --- .../aardvark/frontend/js/templates/userManagementView.ejs | 2 +- .../aardvark/frontend/js/views/userManagementView.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/js/apps/system/aardvark/frontend/js/templates/userManagementView.ejs b/js/apps/system/aardvark/frontend/js/templates/userManagementView.ejs index 63aa751e89..67f5e23834 100644 --- a/js/apps/system/aardvark/frontend/js/templates/userManagementView.ejs +++ b/js/apps/system/aardvark/frontend/js/templates/userManagementView.ejs @@ -89,7 +89,7 @@
  • - +
    <%=avatar %>
    diff --git a/js/apps/system/aardvark/frontend/js/views/userManagementView.js b/js/apps/system/aardvark/frontend/js/views/userManagementView.js index e5cb2d4af1..db7a95471e 100644 --- a/js/apps/system/aardvark/frontend/js/views/userManagementView.js +++ b/js/apps/system/aardvark/frontend/js/views/userManagementView.js @@ -177,7 +177,7 @@ editUser : function(e) { this.collection.fetch(); - this.userToEdit = $(e.currentTarget).attr("id"); + this.userToEdit = this.evaluateUserName($(e.currentTarget).attr("id"), '_edit-user'); $('#editUserModal').modal('show'); var user = this.collection.findWhere({user: this.userToEdit}); $('#editUsername').html(user.get("user")); @@ -274,9 +274,15 @@ $('#sortType').attr('checked', searchOptions.sortBy === 'type'); $('#sortOrder').attr('checked', searchOptions.sortOrder !== 1); */ + }, + + evaluateUserName : function(str, substr) { + var index = str.lastIndexOf(substr); + return str.substring(0, index); } + }); }());