From 2b6997aa939fa2c25b1271b4b7a0f13f87a1828f Mon Sep 17 00:00:00 2001 From: zhanghongqing <13664257052@163.com> Date: Mon, 8 Oct 2018 17:18:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=85=8D=E7=BD=AE=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=97=B6=E6=8F=8F=E8=BF=B0=E7=9A=84=E6=96=87=E5=AD=97?= =?UTF-8?q?=E9=95=BF=E6=98=BE=E7=A4=BA128=EF=BC=8C=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E7=9A=84=E8=BF=87=E9=95=BF=E6=96=87=E5=AD=97?= =?UTF-8?q?=E6=88=AA=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../webapp/static/global/scripts/common.js | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/main/webapp/static/global/scripts/common.js b/src/main/webapp/static/global/scripts/common.js index 7cd21481c..192d5d99c 100644 --- a/src/main/webapp/static/global/scripts/common.js +++ b/src/main/webapp/static/global/scripts/common.js @@ -1,4 +1,25 @@ $(function(){ + //增加描述新增时的文字长度限制 + $("form input[name='cfgDesc']").attr("maxlength","128") + //截取过长的文字 使用id选择器;例如:tab对象->tr->td对象. 排除日志table .logTb + $("#contentTable").not(".logTb").find("td").each(function(i){ + //获取td当前对象的文本,如果长度大于25; + if($(this).text().trim().length>28){ + //给td设置title属性,并且设置td的完整值.给title属性. + var strTitle = $(this).text().trim(); + //解决火狐title不能自动换行 + var count = Math.floor(strTitle.length/64); + for(var i=1;i<=count;i++){ + strTitle=strTitle.substring(0,i*64-1)+"\n"+strTitle.substring(i*64-1); + } + $(this).attr("title",strTitle); + //获取td的值,进行截取。赋值给text变量保存. + var text=$(this).text().substring(0,25)+"..."; + //重新为td赋值; + $(this).text(text); + } + }); + $("input[name$='isCaseSenstive']").on("change",function(){ setIsHexBin(this); });