mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
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:
@@ -440,57 +440,68 @@ function sprintf(format, etc) {
|
|||||||
|
|
||||||
return this.each(function() {
|
return this.each(function() {
|
||||||
|
|
||||||
config = $.extend(this.config, $.tablesorterPager.defaults, settings);
|
try
|
||||||
|
{
|
||||||
|
config = $.extend(this.config, $.tablesorterPager.defaults, settings);
|
||||||
|
|
||||||
var table = this, pager = config.container;
|
var table = this, pager = config.container;
|
||||||
|
|
||||||
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);
|
|
||||||
restoreParams(table, config);
|
|
||||||
|
|
||||||
//$(this).trigger("appendCache"); // Load the data
|
setPageSize(table,config.selectedSize, false);
|
||||||
//console.log($.tablesorterPager);
|
restoreParams(table, config);
|
||||||
applySelection(table);
|
|
||||||
|
|
||||||
$('.gotopage',pager).click(function() {
|
//$(this).trigger("appendCache"); // Load the data
|
||||||
var idx = $(this).attr('page');
|
//console.log($.tablesorterPager);
|
||||||
table.config.page = idx;
|
|
||||||
moveToPage(table);
|
|
||||||
});
|
|
||||||
|
|
||||||
$(config.cssFirst,pager).click(function() {
|
|
||||||
moveToFirstPage(table);
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
$(config.cssNext,pager).click(function() {
|
|
||||||
moveToNextPage(table);
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
$(config.cssPrev,pager).click(function() {
|
|
||||||
moveToPrevPage(table);
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
$(config.cssLast,pager).click(function() {
|
|
||||||
moveToLastPage(table);
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
$(config.cssPageSize,pager).change(function() {
|
|
||||||
setPageSize(table,parseInt($(this).val()), true);
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
$(table).find(':checkbox.checkAll').removeAttr('onclick').click(function() {
|
|
||||||
return checkAll(table, pager, this.checked);
|
|
||||||
});
|
|
||||||
|
|
||||||
$(table).bind('load_selection', function() {
|
|
||||||
loadSelection(table, pager);
|
|
||||||
applySelection(table);
|
applySelection(table);
|
||||||
});
|
|
||||||
$(table).bind('check_all', function() {
|
$('.gotopage',pager).click(function() {
|
||||||
checkAll(table, pager, true);
|
var idx = $(this).attr('page');
|
||||||
});
|
table.config.page = idx;
|
||||||
|
moveToPage(table);
|
||||||
|
});
|
||||||
|
|
||||||
|
$(config.cssFirst,pager).click(function() {
|
||||||
|
moveToFirstPage(table);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
$(config.cssNext,pager).click(function() {
|
||||||
|
moveToNextPage(table);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
$(config.cssPrev,pager).click(function() {
|
||||||
|
moveToPrevPage(table);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
$(config.cssLast,pager).click(function() {
|
||||||
|
moveToLastPage(table);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
$(config.cssPageSize,pager).change(function() {
|
||||||
|
setPageSize(table,parseInt($(this).val()), true);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
$(table).find(':checkbox.checkAll').removeAttr('onclick').click(function() {
|
||||||
|
return checkAll(table, pager, this.checked);
|
||||||
|
});
|
||||||
|
|
||||||
|
$(table).bind('load_selection', function() {
|
||||||
|
loadSelection(table, pager);
|
||||||
|
applySelection(table);
|
||||||
|
});
|
||||||
|
$(table).bind('check_all', function() {
|
||||||
|
checkAll(table, pager, true);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch(err)
|
||||||
|
{
|
||||||
|
if (console && console.log)
|
||||||
|
{
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user