From 8d68272f1b4c6e0a05376611f10a036c4fce3672 Mon Sep 17 00:00:00 2001 From: Jim Mason Date: Wed, 11 Dec 2024 19:15:52 +0000 Subject: [PATCH] fixed to avoid cloud re-layout on trivial resize --- js/trending.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/trending.js b/js/trending.js index 374e4ed8..11ffa4ac 100644 --- a/js/trending.js +++ b/js/trending.js @@ -24,6 +24,7 @@ var trending = null; var loading = false; +var lastsize = 0; var timeout; function reposition() { @@ -45,8 +46,14 @@ function reposition() { function loadCloud() { if(trending && !loading) { - loading = true; var width = $(".content").outerWidth(); + + // avoid re-layout on trivial resize + if(Math.abs(lastsize - width) < 10) + return; + + loading = true; + lastsize = width; $("#cloud").css('opacity', 0).empty().jQCloud(trending, { width: width, height: 350,