排除table 中短文本td 不做title 处理
This commit is contained in:
@@ -33,8 +33,9 @@ $(function(){
|
|||||||
$("form input[name$='cfgKeywords']").attr("maxlength","1024");
|
$("form input[name$='cfgKeywords']").attr("maxlength","1024");
|
||||||
$("form input[class~='domainCheck']").attr("maxlength","1024");
|
$("form input[class~='domainCheck']").attr("maxlength","1024");
|
||||||
//截取过长的文字 使用id选择器;例如:tab对象->tr->td对象. 排除日志table .logTb
|
//截取过长的文字 使用id选择器;例如:tab对象->tr->td对象. 排除日志table .logTb
|
||||||
$("#contentTable").find("td").each(function(i){
|
$("#contentTable").find("td").each(function(i,element){
|
||||||
//获取td当前对象的文本,如果长度大于25;
|
//获取td当前对象的文本,如果长度大于25;
|
||||||
|
if(!$(element).find(".tooltips").length>0){
|
||||||
if($(this).text().trim().length>28){
|
if($(this).text().trim().length>28){
|
||||||
//给td设置title属性,并且设置td的完整值.给title属性.
|
//给td设置title属性,并且设置td的完整值.给title属性.
|
||||||
var strTitle = $(this).text().trim().replace(/[\r\n]/g,"").replace(/\s+/g, " ");
|
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)+"...";
|
var text=$(this).text().trim().substring(0,25)+"...";
|
||||||
//重新为td赋值;
|
//重新为td赋值;
|
||||||
$(this).text(text);
|
$(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(){
|
$("input[name$='isCaseSenstive']").on("change",function(){
|
||||||
@@ -75,7 +74,7 @@ $(function(){
|
|||||||
}else{
|
}else{
|
||||||
text=$(element).text().trim()
|
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();
|
text=$(element).attr("title").trim();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user