diff options
author | hikalkan <hi_kalkan@yahoo.com> | 2013-09-21 12:19:12 +0300 |
---|---|---|
committer | hikalkan <hi_kalkan@yahoo.com> | 2013-09-21 12:19:12 +0300 |
commit | 88e4d6e2f42462e421b95230556cb534d24958e1 (patch) | |
tree | f2a03895bfd44c084111fbd76cc96105d98b9054 /dev/jquery.jtable.core.js | |
parent | 4d2ec0b55ae2c0b7e2cd3089d9b5cb25bde833de (diff) | |
download | jtable-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.js | 20 |
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); } }; |