diff options
author | Jochen Topf <jochen@topf.org> | 2014-05-21 10:00:10 +0200 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2014-05-21 10:00:10 +0200 |
commit | 05c12d0a3346c34164c5919f2a76e2d81ad4ea75 (patch) | |
tree | 2825a6459da08df4b36e85526df1f2c19ecc5ef4 /web/viewsjs | |
parent | c9a8b267ba890836cce28fecab99e6e8b2faeeb7 (diff) | |
download | taginfo-05c12d0a3346c34164c5919f2a76e2d81ad4ea75.tar taginfo-05c12d0a3346c34164c5919f2a76e2d81ad4ea75.tar.gz |
Bugfix: Very small lists of keys/tags/relations broke js on homepage.
Diffstat (limited to 'web/viewsjs')
-rw-r--r-- | web/viewsjs/index.js.erb | 6 |
1 files changed, 3 insertions, 3 deletions
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(' • '); |