diff options
author | Rouslan Placella <rouslan@placella.com> | 2012-06-21 01:36:54 +0400 |
---|---|---|
committer | Rouslan Placella <rouslan@placella.com> | 2012-10-31 00:07:01 +0400 |
commit | 3ca7d34240d5e6c173cc492662a2d4a2713b8306 (patch) | |
tree | da3ed8aa4bd4f3be91b6a0fb0f977c09cee94a5b /js/server_variables.js | |
parent | 5838a4433921f285c70706146343bb21f0430b4a (diff) |
Destroy registered jQuery events on page tear down
Diffstat (limited to 'js/server_variables.js')
-rw-r--r-- | js/server_variables.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/js/server_variables.js b/js/server_variables.js index 2a44166c96..7f2ba9620e 100644 --- a/js/server_variables.js +++ b/js/server_variables.js @@ -1,4 +1,13 @@ /* vim: set expandtab sw=4 ts=4 sts=4: */ + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('server_variables.js', function() { + $('table.data tbody tr td:nth-child(2).editable').unbind('hover'); + $('#filterText').unbind('keyup'); +}); + AJAX.registerOnload('server_variables.js', function() { var textFilter = null, odd_row = false; var testString = 'abcdefghijklmnopqrstuvwxyz0123456789,ABCEFGHIJKLMOPQRSTUVWXYZ'; @@ -47,7 +56,7 @@ AJAX.registerOnload('server_variables.js', function() { charWidth = $tmpDiv.width() / testString.length; $tmpDiv.remove(); - $(window).resize(limitTableWidth); + $(window).resize(limitTableWidth); // FIXME: this doesn't work that well and binding anything to the window resize event is a bad idea limitTableWidth(); /* This function chops of long variable values to keep the table from overflowing horizontally |