X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plekit%2Ftablesort%2Ftablesort.js;h=e9e805806b0c8d49fe20bc30cbb04021b9e720b4;hb=ab7d755720166fb4ce7acaf629463dc7f0a00ffe;hp=c52382cb412183c8588a255d0688850fdcc72fbc;hpb=8b14cad706b15758cd22d392e3989818f72cd246;p=plewww.git diff --git a/plekit/tablesort/tablesort.js b/plekit/tablesort/tablesort.js index c52382c..e9e8058 100644 --- a/plekit/tablesort/tablesort.js +++ b/plekit/tablesort/tablesort.js @@ -213,8 +213,8 @@ fdTableSort = { columnNumSortObj[i]["thNode"] = workArr[c][i]; columnNumSortObj["active"] = true; }; - - thtext = fdTableSort.getInnerText(workArr[c][i], true); + th_elt = workArr[c][i]; + thtext = fdTableSort.getInnerText(th_elt, true); for(var cn = workArr[c][i].childNodes.length; cn--;) { // Skip image nodes and links created by the filter script. @@ -230,7 +230,12 @@ fdTableSort = { aclone = a.cloneNode(true); //aclone.appendChild(document.createTextNode(thtext)); aclone.innerHTML = thtext; - aclone.title = "Sort on \u201c" + thtext.replace('
', '') + "\u201d"; + //if the has title set, use this as an alternate text for the 'sort on ...' + if (th_elt.title) { + aclone.title = th_elt.title; + } else { + aclone.title = "Sort on \u201c" + (th_elt.title ? th_elt.title : thtext.replace('
', '')) + "\u201d"; + } aclone.onclick = aclone.onkeydown = workArr[c][i].onclick = fdTableSort.initWrapper; workArr[c][i].appendChild(aclone); if(showArrow) workArr[c][i].appendChild(span.cloneNode(false));