Skip to content
Permalink
Browse files
[FIXED JENKINS-21729] Fix IE8 NPE with respect to sortability
IE8 (and I assume other browsers that use a doctype pre-html5) interpret the span outside of the link, as in HTML4.01 you needed the closing tag.
http://www.w3.org/TR/REC-html40/struct/global.html#h-7.5.4

The code was causing a NPE in IE8 and users could not sort the columns.

>> cell.innerHTML = '<a href="#" class="sortheader">'+this.getInnerText(cell)+'<span class="sortarrow" /></a>';

>> cell.innerHTML ;
"<A class=sortheader href="#"> S<SPAN class=sortarrow></A></SPAN>"

>> cell.innerHTML = '<a href="#" class="sortheader">'+this.getInnerText(cell)+'<span class="sortarrow"></span></a>'

>> cell.innerHTML ;
"<A class=sortheader href="#"> S<SPAN class=sortarrow></SPAN></A>"
  • Loading branch information
anafke authored and kohsuke committed Apr 19, 2014
1 parent 3cde986 commit 6566a0c7f9418469281f68cf243ca15d0ec32e95
Showing with 4 additions and 1 deletion.
  1. +3 −0 changelog.html
  2. +1 −1 war/src/main/webapp/scripts/sortable.js
@@ -55,6 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
Fixed a JavaScript problem in sortable table with IE8.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-21729">issue 21729</a>)
<li class=bug>
More efficient deletion of old builds (specified by date).
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-22607">issue 22607</a>)
@@ -55,7 +55,7 @@ var Sortable = (function() {

// We have a first row: assume it's the header, and make its contents clickable links
firstRow.each(function (cell){
cell.innerHTML = '<a href="#" class="sortheader">'+this.getInnerText(cell)+'<span class="sortarrow" /></a>';
cell.innerHTML = '<a href="#" class="sortheader">'+this.getInnerText(cell)+'<span class="sortarrow"></span></a>';
this.arrows.push(cell.firstChild.lastChild);

var self = this;

0 comments on commit 6566a0c

Please sign in to comment.