From da9ea20e8f447c5362bb5d7c4d2d5fee027c2b51 Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Mon, 8 Apr 2019 16:00:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9tagsInput=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=A1=86=E9=95=BF=E5=BA=A6=E4=B8=BA1=E6=97=B6=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E4=BF=9D=E6=8A=A4=E5=90=8D=E5=8D=95=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/static/global/scripts/common.js | 59 ++++++++++--------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index cbf14de7a..c0a65619d 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -438,43 +438,48 @@ $(function(){ 'delimiter':'***and***',//特殊字符串分隔与表达式的多关键词 maxCount:4, onAddTag:function(tag,size){ - var reg = new RegExp(/\t|\r|\n/); + var reg = new RegExp(/\t|\r|\n/); if (tag.match(reg)) { $(this).parent(".col-md-6").next("div").html(""); }else{ $(this).parent(".col-md-6").next("div").html(""); } //var keywordValue = ""; - var objNamePrefix = $(this).attr("name").split("cfgKeywords")[0]; - /*$("span[class='tag']").each(function(){ - keywordValue = keywordValue+"***iie***"+$(this).find("span").text().trim(); - }); - $(this).prev("input[name$='cfgKeywords']").val(keywordValue);*/ - exprTypeChecked(objNamePrefix,size,options); - - var tagObj = $(this); - for(var key in protectionData){ - if(tagObj.hasClass(key)){ - protectedListWarn(tagObj,key); - } - } - }, - onRemoveTag:function(tag,size){ - $(this).parent(".col-md-6").next("div").html(""); - //var keywordValue = ""; - var objNamePrefix = $(this).attr("name").split("cfgKeywords")[0]; - /*$("span[class='tag']").each(function(){ + var objNamePrefix = $(this).attr("name").split("cfgKeywords")[0]; + /*$("span[class='tag']").each(function(){ keywordValue = keywordValue+"***iie***"+$(this).find("span").text().trim(); }); $(this).prev("input[name$='cfgKeywords']").val(keywordValue);*/ - exprTypeChecked(objNamePrefix,size,options); + exprTypeChecked(objNamePrefix,size,options); + + if(size == 1){ + var tagObj = $(this); + for(var key in protectionData){ + if(tagObj.hasClass(key)){ + protectedListWarn(tagObj,key); + } + } + } + + }, + onRemoveTag:function(tag,size){ + $(this).parent(".col-md-6").next("div").html(""); + //var keywordValue = ""; + var objNamePrefix = $(this).attr("name").split("cfgKeywords")[0]; + /*$("span[class='tag']").each(function(){ + keywordValue = keywordValue+"***iie***"+$(this).find("span").text().trim(); + }); + $(this).prev("input[name$='cfgKeywords']").val(keywordValue);*/ + exprTypeChecked(objNamePrefix,size,options); - var tagObj = $(this); - for(var key in protectionData){ - if(tagObj.hasClass(key)){ - protectedListWarn(tagObj,key); - } - } + if(size == 1){ + var tagObj = $(this); + for(var key in protectionData){ + if(tagObj.hasClass(key)){ + protectedListWarn(tagObj,key); + } + } + } } }); $(".tagsinput").popover({