diff options
author | Vinzenz <vinzenz.rosenkranz@gmail.com> | 2016-03-04 23:22:07 +0300 |
---|---|---|
committer | Vinzenz <vinzenz.rosenkranz@gmail.com> | 2016-03-04 23:22:07 +0300 |
commit | 90fd6eb06d252eb8e672bb93a16e7364375f2888 (patch) | |
tree | cc9ccc20d6a0e1e37d4c5ccbb65d54daf9da840b /js | |
parent | 8ec29ea0c56870fffd86506b0b9db24df49de29f (diff) |
only use display name in ui, not logic
Diffstat (limited to 'js')
-rw-r--r-- | js/create_edit.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/js/create_edit.js b/js/create_edit.js index e7849dec..6d0fae97 100644 --- a/js/create_edit.js +++ b/js/create_edit.js @@ -38,11 +38,11 @@ $(document).ready(function () { var val = accessValueArr[i]; var index = val.indexOf('group_'); if(index == 0) { - g_chosen_groups.push(val.substring(6)); + g_chosen_groups.push(val); } else { index = val.indexOf('user_'); if(index == 0) { - g_chosen_users.push(val.substring(5)); + g_chosen_users.push(val); } } } @@ -216,23 +216,23 @@ $(document).ready(function () { $(document).on('click', '.cl_user_item', function(e) { $(this).switchClass('cl_user_item', 'cl_user_item_selected'); - g_tmp_users.push(this.innerHTML); + g_tmp_users.push(this.id); }); $(document).on('click', '.cl_user_item_selected', function(e) { $(this).switchClass('cl_user_item_selected', 'cl_user_item'); - var index = g_tmp_users.indexOf(this.innerHTML); + var index = g_tmp_users.indexOf(this.id); if(index > -1) g_tmp_users.splice(index, 1); }); $(document).on('click', '.cl_group_item', function(e) { $(this).switchClass('cl_group_item', 'cl_group_item_selected'); - g_tmp_groups.push(this.innerHTML); + g_tmp_groups.push(this.id); }); $(document).on('click', '.cl_group_item_selected', function(e) { $(this).switchClass('cl_group_item_selected', 'cl_group_item'); - var index = g_tmp_groups.indexOf(this.innerHTML); + var index = g_tmp_groups.indexOf(this.id); if(index > -1) g_tmp_groups.splice(index, 1); }); @@ -427,7 +427,7 @@ function showAccessDialog() { var curr = cells_grp[i]; curr.className = 'cl_group_item'; for(var j=0; j<tmpGroups.length; j++) { - if(tmpGroups[j] == curr.innerHTML) { + if(tmpGroups[j] == curr.id) { curr.className = 'cl_group_item_selected'; tmpGroups.splice(j, 1); break; @@ -439,7 +439,7 @@ function showAccessDialog() { var curr = cells_usr[i]; curr.className = 'cl_user_item'; for(var j=0; j<tmpUsers.length; j++) { - if(tmpUsers[j] == curr.innerHTML) { + if(tmpUsers[j] == curr.id) { curr.className = 'cl_user_item_selected'; tmpUsers.splice(j, 1); break; |