1
0
Fork 0

fixed index problem

This commit is contained in:
gschwab 2014-03-14 09:37:30 +01:00
parent fe596f98d6
commit c4ea53e70e
2 changed files with 8 additions and 2 deletions

View File

@ -89,7 +89,7 @@
<li class="tile">
<div class="iconSet">
<span class="icon_arangodb_settings2 editUser" id="<%=username %>" alt="Edit user" title="Edit user"></span>
<span class="icon_arangodb_settings2 editUser" id="<%=username %>_edit-user" alt="Edit user" title="Edit user"></span>
</div>
<%=avatar %>
<div class="tileBadge">

View File

@ -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);
}
});
}());