From 2646db9ea2ad5984ec25be5d519238e96233b34d Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 22 Feb 2019 20:12:25 +0100 Subject: [PATCH] Remove the domReady madness, use DOMContentLoaded event like in global.js --- portal/assets/js/ynhpanel.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/portal/assets/js/ynhpanel.js b/portal/assets/js/ynhpanel.js index a6913d2..377c777 100644 --- a/portal/assets/js/ynhpanel.js +++ b/portal/assets/js/ynhpanel.js @@ -194,20 +194,11 @@ function make_element_draggable(id) { }); }; -/* Smallest DOMReady - http://dustindiaz.com/smallest-domready-ever --------------------------- */ -function domReady(cb) { - /in/.test(document.readyState) // in = loadINg - ? setTimeout('domReady('+cb+')', 9) - : cb(); -} - - /* ---------------------------------------------------------- Main ---------------------------------------------------------- */ -domReady(function(){ +document.addEventListener('DOMContentLoaded', function() { + // Don't do this in iframe if (window.self !== window.top) {return false;}