Index: lams_admin/web/userorg.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_admin/web/userorg.jsp,v
diff -u -r1.22.2.2 -r1.22.2.3
--- lams_admin/web/userorg.jsp 9 Feb 2016 11:28:41 -0000 1.22.2.2
+++ lams_admin/web/userorg.jsp 3 Mar 2016 14:25:03 -0000 1.22.2.3
@@ -63,8 +63,8 @@
function bindAddLink() {
jQuery("a.addLink").click(function() {
- var rowText = jQuery(this).parent().text();
var rowId = jQuery(this).parent().attr("id");
+ var rowText = jQuery(this).parent().text();
jQuery("div#existing").append("
"+rowText+"");
jQuery(this).parent().remove();
updateExistingTotal();
@@ -98,19 +98,25 @@
function loadSearchResultsCallback(potential) {
updatePotentialTotal();
jQuery("li", "div#potential").each(function() {
- var rowHtml = jQuery(this).html();
- jQuery(this).html(""+rowHtml+"");
+ if ($('div#existing li#' + $(this).attr('id')).length > 0) {
+ $(this).remove();
+ } else {
+ $(this).html(""+$(this).html()+"");
+ }
});
if (potential == '1') {
for (var userId in removedUsers) {
- jQuery("div#potential").append("" + removedUsers[userId] + "");
+ if ($('div#existing li#' + userId + ', div#potential li#' + userId).length == 0) {
+ $("div#potential").append("" + removedUsers[userId] + "");
+ }
}
removedUsers = [];
} else {
for (var userId in removedUsers) {
var term = jQuery("#term").val();
- if (removedUsers[userId].toLowerCase().indexOf(term.toLowerCase()) >= 0) {
+ if (removedUsers[userId].toLowerCase().indexOf(term.toLowerCase()) >= 0
+ && $('div#existing li#' + userId + ', div#potential li#' + userId).length == 0) {
jQuery("div#potential").append("" + removedUsers[userId] + "");
delete removedUsers[userId];
}