Skip to content

Commit

Permalink
added comment (non-semantic change)
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketMan committed Dec 16, 2024
1 parent af1ba63 commit 49040bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 3 additions & 3 deletions css/trending.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ div.jqcloud {
div.jqcloud span { padding: 4px; }

div.jqcloud.invisible {
position: absolute;
top: -9999px;
left: -9999px;
position: absolute;
top: -9999px;
left: -9999px;
}

/* loading */
Expand Down
8 changes: 8 additions & 0 deletions js/trending.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var lastsize = 0;
var timeout;

function reposition() {
// determine the left and top edges of the word cloud
var pos = loading.children('span').toArray().reduce(function(carry, span) {
if(span.offsetLeft < carry.left)
carry.left = span.offsetLeft;
Expand All @@ -36,6 +37,7 @@ function reposition() {
return carry;
}, { left: 10000, top: 10000 } );

// reposition the word cloud to the upper left of the content area
loading.css('margin-left', -pos.left + 'px')
.css('margin-top', -pos.top+20 + 'px');

Expand All @@ -51,6 +53,7 @@ function reposition() {
function loadCloud() {
if(trending && !loading) {
var content = $(".content");

// shrink slightly to ensure we remain within the container
var width = content.outerWidth() - 50;
var height = content.outerHeight() - 50;
Expand All @@ -61,6 +64,11 @@ function loadCloud() {

lastsize = width;

// The div must be in the DOM *and* visible for jQCloud.
//
// We absolute position the div offscreen (class 'invisible'),
// let jQCloud do the layout, and then reposition the div into
// the normal document flow upon completion.
loading = $("<div>", {
class: "jqcloud invisible"
});
Expand Down

0 comments on commit 49040bb

Please sign in to comment.