diff --git a/core/src/main/resources/org/apache/spark/ui/static/sorttable.js b/core/src/main/resources/org/apache/spark/ui/static/sorttable.js
index ecd580e5c64aa..3f98a0379dc3c 100644
--- a/core/src/main/resources/org/apache/spark/ui/static/sorttable.js
+++ b/core/src/main/resources/org/apache/spark/ui/static/sorttable.js
@@ -99,12 +99,12 @@ sorttable = {
'sorttable_sorted_reverse');
rowlists = this.parentNode.getElementsByTagName("span");
for (var j=0; j < rowlists.length; j++) {
- if (rowlists[j].className.search(/\bsorttable_sortfwdind\b/)) {
+ if (rowlists[j].className.search(/\bsorttable_sortfwdind\b/) != -1) {
rowlists[j].parentNode.removeChild(rowlists[j]);
}
}
sortrevind = document.createElement('span');
- sortrevind.class = "sorttable_sortrevind";
+ sortrevind.className = "sorttable_sortrevind";
sortrevind.innerHTML = stIsIE ? ' 5' : ' ▾';
this.appendChild(sortrevind);
return;
@@ -117,12 +117,12 @@ sorttable = {
'sorttable_sorted');
rowlists = this.parentNode.getElementsByTagName("span");
for (var j=0; j < rowlists.length; j++) {
- if (rowlists[j].className.search(/\sorttable_sortrevind\b/)) {
+ if (rowlists[j].className.search(/\bsorttable_sortrevind\b/) != -1) {
rowlists[j].parentNode.removeChild(rowlists[j]);
}
}
sortfwdind = document.createElement('span');
- sortfwdind.class = "sorttable_sortfwdind";
+ sortfwdind.className = "sorttable_sortfwdind";
sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▴';
this.appendChild(sortfwdind);
return;
@@ -138,15 +138,15 @@ sorttable = {
});
rowlists = this.parentNode.getElementsByTagName("span");
for (var j=0; j < rowlists.length; j++) {
- if (rowlists[j].className.search(/\bsorttable_sortfwdind\b/)
- || rowlists[j].className.search(/\sorttable_sortrevind\b/) ) {
+ if (rowlists[j].className.search(/\bsorttable_sortfwdind\b/) != -1
+ || rowlists[j].className.search(/\bsorttable_sortrevind\b/) != -1) {
rowlists[j].parentNode.removeChild(rowlists[j]);
}
}
this.className += ' sorttable_sorted';
sortfwdind = document.createElement('span');
- sortfwdind.class = "sorttable_sortfwdind";
+ sortfwdind.className = "sorttable_sortfwdind";
sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▴';
this.appendChild(sortfwdind);