From f105fca9a78eab51d82696548372d37ce2c14fec Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Tue, 22 Jan 2019 07:44:18 +0000 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=97=A5=E5=BF=97=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E4=B8=AD=E6=96=87=E5=AD=97=E5=B8=A6=E6=8D=A2=E8=A1=8C?= =?UTF-8?q?=E7=A9=BA=E6=A0=BC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit b03ec51aa48553d2f5c45b3548f1a5f52f81970a) --- src/main/webapp/static/global/scripts/common.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index 2b3edc3ad..4322418ea 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -46,6 +46,7 @@ $(function(){ if($(this).text().trim().length>28){ //给td设置title属性,并且设置td的完整值.给title属性. var strTitle = $(this).text().trim().replace(/[\r\n]/g,"").replace(/\s+/g, " "); + $(this).attr("titleHidden",strTitle); // 加一个不含换行的隐藏文本方便其它复制处理 //解决火狐title不能自动换行 var count = Math.floor(strTitle.length/62); for(var i=1;i<=count;i++){ @@ -107,9 +108,12 @@ $(function(){ text=$(element).text().trim() } 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(); - +// text=$(element).attr("titleHidden").trim(); +// if(text==null&&text==''){ + text=$(element).attr("title").trim(); +// } } +// text=text.replace(/[\r\n]/g,"");// 去掉换行 //特殊字符转义 text=text.replace(/[<>&"]/g,function(c){return {'<':'<','>':'>','&':'&','"':'"'}[c];});