2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

sorttable.js: added version, catch errors for tables without headings

git-svn-id: https://svn.fhem.de/fhem/trunk@13106 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2017-01-16 13:12:53 +00:00
parent 284cb98689
commit 8f4085741b

View File

@ -5,6 +5,8 @@
** resorting after fhemweb longpoll updates
*/
var version="$Id$";
/*
SortTable
version 2
@ -190,7 +192,11 @@ sorttable = {
doSort: function(table, column, reverse) {
if( typeof column !== 'object' ) {
if( table === undefined ) {
console.log( 'reSort: no table given' );
console.log( 'doSort: no table given' );
return;
}
if( table.tHead === undefined ) {
console.log( 'doSort: table has no heading' );
return;
}
@ -204,7 +210,7 @@ sorttable = {
}
if( column === undefined ) {
console.log( 'reSort: no current column' );
console.log( 'doSort: no current column' );
return;
}
}