summaryrefslogtreecommitdiffstats
path: root/dev/jquery.jtable.core.js
diff options
context:
space:
mode:
authorhikalkan <hi_kalkan@yahoo.com>2013-09-21 12:19:12 +0300
committerhikalkan <hi_kalkan@yahoo.com>2013-09-21 12:19:12 +0300
commit88e4d6e2f42462e421b95230556cb534d24958e1 (patch)
treef2a03895bfd44c084111fbd76cc96105d98b9054 /dev/jquery.jtable.core.js
parent4d2ec0b55ae2c0b7e2cd3089d9b5cb25bde833de (diff)
downloadjtable-88e4d6e2f42462e421b95230556cb534d24958e1.zip
jtable-88e4d6e2f42462e421b95230556cb534d24958e1.tar.gz
jtable-88e4d6e2f42462e421b95230556cb534d24958e1.tar.bz2
jTable v2.3.1v2.3.1
Bugfixes (#161, #254, #357, #570, #822) and localizations.
Diffstat (limited to 'dev/jquery.jtable.core.js')
-rw-r--r--dev/jquery.jtable.core.js20
1 files changed, 17 insertions, 3 deletions
diff --git a/dev/jquery.jtable.core.js b/dev/jquery.jtable.core.js
index 6c24448..62a3d95 100644
--- a/dev/jquery.jtable.core.js
+++ b/dev/jquery.jtable.core.js
@@ -3,6 +3,15 @@
*************************************************************************/
(function ($) {
+ var unloadingPage;
+
+ $(window).on('beforeunload', function () {
+ unloadingPage = true;
+ });
+ $(window).on('unload', function () {
+ unloadingPage = false;
+ });
+
$.widget("hik.jtable", {
/************************************************************************
@@ -107,7 +116,7 @@
this._createErrorDialogDiv();
this._addNoDataRow();
- this._cookieKeyPrefix = this._generateCookieKeyPrefix();
+ this._cookieKeyPrefix = this._generateCookieKeyPrefix();
},
/* Normalizes some options for all fields (sets default values).
@@ -1099,9 +1108,14 @@
};
//Override error
- opts.error = function () {
+ opts.error = function (jqXHR, textStatus, errorThrown) {
+ if (unloadingPage) {
+ jqXHR.abort();
+ return;
+ }
+
if (options.error) {
- options.error();
+ options.error(arguments);
}
};