From 219fa11d88f53389fd28d7f2170c0d057109f031 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Thu, 15 Nov 2018 15:19:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E9=99=A4table=20=E4=B8=AD=E7=9F=AD?= =?UTF-8?q?=E6=96=87=E6=9C=ACtd=20=E4=B8=8D=E5=81=9Atitle=20=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/static/global/scripts/common.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index 71f3f84a2..123d75ca3 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -33,8 +33,9 @@ $(function(){ $("form input[name$='cfgKeywords']").attr("maxlength","1024"); $("form input[class~='domainCheck']").attr("maxlength","1024"); //截取过长的文字 使用id选择器;例如:tab对象->tr->td对象. 排除日志table .logTb - $("#contentTable").find("td").each(function(i){ - //获取td当前对象的文本,如果长度大于25; + $("#contentTable").find("td").each(function(i,element){ + //获取td当前对象的文本,如果长度大于25; + if(!$(element).find(".tooltips").length>0){ if($(this).text().trim().length>28){ //给td设置title属性,并且设置td的完整值.给title属性. var strTitle = $(this).text().trim().replace(/[\r\n]/g,"").replace(/\s+/g, " "); @@ -48,10 +49,8 @@ $(function(){ var text=$(this).text().trim().substring(0,25)+"..."; //重新为td赋值; $(this).text(text); - } else{ - var strTitle = $(this).text().trim().replace(/[\r\n]/g,"").replace(/\s+/g, " "); - $(this).attr("title",strTitle); - } + } + } }); $("input[name$='isCaseSenstive']").on("change",function(){ @@ -75,7 +74,7 @@ $(function(){ }else{ text=$(element).text().trim() } - if(typeof($(element).attr("title"))!="undefined"&&$(element).attr("title")!=null&&$(element).attr("title").length > 0){ + if(!$(element).find(".tooltips").length>0&&typeof($(element).attr("title"))!="undefined"&&$(element).attr("title")!=null&&$(element).attr("title").length > 0){ text=$(element).attr("title").trim(); }