Hi, I just wanted to share a better way to initialize tablesort, and
hopefully it can make it into the next revision. This code replaces
the last few lines that try to load tablesort either through FastInit
or through the class itself. I haven't tested this much at all, so
there may be a better way to optimize it.
// Try.these tries a series of code blocks until a success.
// var sortableLoaded will be false if all code blocks fail.
var sortableLoaded=Try.these(
function(){
return FastInit.addOnLoad(SortableTable.load);
},
function(){
return Event.observe(window, 'load', SortableTable.load);
}
)||false;
// Throw an error if the class couldn't be loaded.
if(!sortableLoaded){
throw new Error("Could not load the Sortable class. Tables will not
be sortable.");
}