Protect the initialization with a try ... catch, in order to protect that rest of the page in case of trouble.

SVN:2.0.1[3076]
This commit is contained in:
Denis Flaven
2014-02-05 17:11:55 +00:00
parent 1dbb94a2e1
commit 5c1149ac68

View File

@@ -440,6 +440,8 @@ function sprintf(format, etc) {
return this.each(function() { return this.each(function() {
try
{
config = $.extend(this.config, $.tablesorterPager.defaults, settings); config = $.extend(this.config, $.tablesorterPager.defaults, settings);
var table = this, pager = config.container; var table = this, pager = config.container;
@@ -447,6 +449,7 @@ function sprintf(format, etc) {
this.ajax_request = null; this.ajax_request = null;
config.selectedSize = parseInt($(".pagesize",pager).val()); config.selectedSize = parseInt($(".pagesize",pager).val());
setPageSize(table,config.selectedSize, false); setPageSize(table,config.selectedSize, false);
restoreParams(table, config); restoreParams(table, config);
@@ -491,6 +494,14 @@ function sprintf(format, etc) {
$(table).bind('check_all', function() { $(table).bind('check_all', function() {
checkAll(table, pager, true); checkAll(table, pager, true);
}); });
}
catch(err)
{
if (console && console.log)
{
console.log(err);
}
}
}); });
}; };
} }