comment out everything in CloseActivityPanel
function and after commenting your code will be this only as follows:
closeActivityPanel: {
show:function(module,id,new_status,viewType,parentContainerId){
if (SUGAR.util.closeActivityPanel.panel)
SUGAR.util.closeActivityPanel.panel.destroy();
var singleModule = SUGAR.language.get("app_list_strings", "moduleListSingular")[module];
singleModule = typeof(singleModule != 'undefined') ? singleModule.toLowerCase() : '';
var closeText = SUGAR.language.get("app_strings", "LBL_CLOSE_ACTIVITY_CONFIRM").replace("#module#",singleModule);
var args = "action=save&id=" + id + "&record=" + id + "&status=" + new_status + "&module=" + module;
var callback = {
success:function(o)
{
window.setTimeout(function(){if(document.getElementById('search_form')) document.getElementById('search_form').submit(); else window.location.reload(true);}, 0);
},
argument:{'parentContainerId':parentContainerId}
};
YAHOO.util.Connect.asyncRequest('POST', 'index.php', callback, args);
}
},
This way confirmation pop will not come.
In case if you wants to disable onbeforeunload
then use the following code according to your requirement.
$(document).on("submit", "form", function(event){
window.onbeforeunload = null;
});