From 05c12d0a3346c34164c5919f2a76e2d81ad4ea75 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Wed, 21 May 2014 10:00:10 +0200 Subject: Bugfix: Very small lists of keys/tags/relations broke js on homepage. --- web/viewsjs/index.js.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'web/viewsjs') diff --git a/web/viewsjs/index.js.erb b/web/viewsjs/index.js.erb index 8c0286b..29bd4fb 100644 --- a/web/viewsjs/index.js.erb +++ b/web/viewsjs/index.js.erb @@ -83,7 +83,7 @@ function fill_lists() { max_height = jQuery('table').height() / 3 - title_td_height - reserve_height; i = 0; - while (key_list.outerHeight() < max_height) { + while (key_list.outerHeight() < max_height && keys_data[i]) { var d = keys_data[i]; key_list.append(link_to_key(d.text)); key_list.append(' • '); @@ -92,7 +92,7 @@ function fill_lists() { key_list.append('...'); i = 0; - while (tag_list.outerHeight() < max_height) { + while (tag_list.outerHeight() < max_height && tags_data[i]) { var d = tags_data[i]; tag_list.append(link_to_tag(d[0], d[1])); tag_list.append(' • '); @@ -101,7 +101,7 @@ function fill_lists() { tag_list.append('...'); i = 0; - while (relation_list.outerHeight() < max_height) { + while (relation_list.outerHeight() < max_height && relations_data[i]) { var d = relations_data[i]; relation_list.append(link_to_rtype(d)); relation_list.append(' • '); -- cgit v1.2.3