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); });