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

SVN:trunk[3074]
This commit is contained in:
Denis Flaven
2014-02-05 17:08:33 +00:00
parent 6f2c404415
commit a6693d9535

View File

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