Commit 1ef5e976 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(interface): Do not sort last line

Do not sort last line as it’s just a filling empty line.
Also only add sorting when headers are used as we need to click on them
 for sorting.

issue #5708
Showing with 5 additions and 3 deletions
+5 -3
...@@ -79,7 +79,7 @@ var tsorter = (function() ...@@ -79,7 +79,7 @@ var tsorter = (function()
if( that.prevCol !== -1 && that.ths[that.prevCol].className !== 'exc_cell'){ if( that.prevCol !== -1 && that.ths[that.prevCol].className !== 'exc_cell'){
that.ths[that.prevCol].className = ''; that.ths[that.prevCol].className = '';
} }
that.quicksort(0, that.trs.length); that.quicksort(0, that.trs.length - 1);
} }
that.prevCol = that.column; that.prevCol = that.column;
}, },
...@@ -152,7 +152,7 @@ var tsorter = (function() ...@@ -152,7 +152,7 @@ var tsorter = (function()
var that = this, var that = this,
i; i;
for( i = 1; i < that.trs.length; i++ ) { for( i = 1; i < (that.trs.length - 1); i++ ) {
that.tbody.insertBefore( that.trs[i], that.trs[0] ); that.tbody.insertBefore( that.trs[i], that.trs[0] );
} }
}, },
......
...@@ -105,10 +105,12 @@ class divSelectBox ...@@ -105,10 +105,12 @@ class divSelectBox
">\n"; ">\n";
$s_return .= $this->_generatePage(); $s_return .= $this->_generatePage();
$s_return .= '</table></div></div>'; $s_return .= '</table></div></div>';
$s_return .= if ($this->headers !== FALSE) {
$s_return .=
'<script type="text/javascript"> '<script type="text/javascript">
var sorter'.$this->id.' = tsorter.create(\''.$this->id.'\'); var sorter'.$this->id.' = tsorter.create(\''.$this->id.'\');
</script>'; </script>';
}
return $s_return; return $s_return;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment