1
0

Fix for ticket #1242. Don't try to initialize the tag_cloud.swf file if there are no tags present.

This commit is contained in:
Tim Almdal 2010-07-23 07:29:47 -07:00
parent 1370d60202
commit d88688c074

View File

@ -26,7 +26,7 @@
success: function(data) {
if (data.result == "success") {
$.get($("#g-tag-cloud").attr("ref"), function(data, textStatus) {
swfobject.removeSWF("g-tag-cloud-movie");
$("#g-tag-cloud-movie").remove();
$("#g-tag-cloud").append("<div id='g-tag-cloud-movie'>" + data + "</div>");
self._set_tag_cloud();
});
@ -39,9 +39,14 @@
_set_tag_cloud: function() {
var self = this;
var taglist = $("#g-tag-cloud a");
if (taglist.length == 0) {
return;
}
var width = $("#g-tag-cloud").width();
var tags = document.createElement("tags");
$("#g-tag-cloud a").each(function(i) {
taglist.each(function(i) {
var addr = $(this).clone();
$(addr).attr("style", "font-size: 14pt;");
$(tags).append(addr);