From 05dd800abdced0b5c7f37896f17a8daa17cf00a5 Mon Sep 17 00:00:00 2001 From: Julen Ruiz Aizpuru Date: Thu, 21 Jul 2016 15:39:30 +0200 Subject: [PATCH] Sorttable: avoid registering init multiple times The script pre-dates jQuery usage so it's understandable the amount of workarounds and boilerplate that were needed back then to run code at startup. They are not necessary anymore and this commit removes them which also avoids to register extra listeners to run the init callback. --- pootle/static/js/vendor/sorttable.js | 37 +--------------------------- 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/pootle/static/js/vendor/sorttable.js b/pootle/static/js/vendor/sorttable.js index 3e71654e7c4..b7182da3404 100644 --- a/pootle/static/js/vendor/sorttable.js +++ b/pootle/static/js/vendor/sorttable.js @@ -23,13 +23,6 @@ sorttable = { init: function() { - // quit if this function has already been called - if (arguments.callee.done) return; - // flag this function so we don't do the same thing twice - arguments.callee.done = true; - // kill the timer - if (_timer) clearInterval(_timer); - if (!document.createElement || !document.getElementsByTagName) return; sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; @@ -401,35 +394,7 @@ sorttable = { // Dean Edwards/Matthias Miller/John Resig -/* for Mozilla/Opera9 */ -if (document.addEventListener) { - document.addEventListener("DOMContentLoaded", sorttable.init, false); -} - -/* for Internet Explorer */ -/*@cc_on @*/ -/*@if (@_win32) - var dummy = (location.protocol == "https:") ? "//:" : "javascript:void(0)"; - document.write('