From ca3d4de819b7fb5f72d01b7be8a37a51986f5548 Mon Sep 17 00:00:00 2001 From: guanghongwei Date: Mon, 26 Jan 2015 11:51:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9js=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/jperm/perm_edit.html | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/templates/jperm/perm_edit.html b/templates/jperm/perm_edit.html index 9491d5b1a..1ce00ec94 100644 --- a/templates/jperm/perm_edit.html +++ b/templates/jperm/perm_edit.html @@ -20,14 +20,13 @@ function search_host(text){ $("#host_unperm").children().each(function(){$(this).remove();}); + var permArray = []; + $("#host_permed").children().each(function(){ + permArray.push($(this).text()); + }); $("#host_all").children().each(function(){ - if ($(this).text().search(text) != -1){ -{# $("#host_permed").children().each(function(){#} -{# if ($(this).text().search(text) == -1){#} -{# $("#host_unperm").append($(this).clone())#} -{# }#} -{# });#} - $("#host_unperm").append($(this).clone()) + if ($(this).text().search(text) != -1 && permArray.indexOf($(this).text()) == -1) { + $("#host_unperm").append($(this).clone()) } }); }