Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Change tag cloud height computation
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Mar 20, 2014
1 parent 79aa339 commit d70ccc0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion synoptic/__init__.py
Expand Up @@ -120,7 +120,7 @@ def __init__(self, sub_app, dburl, exists, echo=False):

from sqlalchemy.pool import NullPool
from sqlalchemy import create_engine
self.engine = create_engine(dburl, poolclass=NullPool)
self.engine = create_engine(dburl, poolclass=NullPool, echo=True)

from synoptic.datamodel import DataModel
self.datamodel = DataModel()
Expand Down
17 changes: 10 additions & 7 deletions synoptic/html.py
Expand Up @@ -117,18 +117,21 @@ def navpane(context):
<div id="fragment-1">
<div id="subtagcloud_search_tags"> </div>
<div id="subtagcloud" class="tagcloud"> </div>
<input type="checkbox" id="chk_subtagcloud_show_hidden"/>
<span id="navtab_size_helper_top_1"></span>
<label for="chk_subtagcloud_show_hidden">Show hidden (.<i>tag</i>)</label>
<div id="tagcloud_hidden_control_1">
<input type="checkbox" id="chk_subtagcloud_show_hidden"/>
<label for="chk_subtagcloud_show_hidden">
Show hidden (.<i>tag</i>)
</label>
</div>
</div>
<div id="fragment-2">
<div id="tagcloud" class="tagcloud"> </div>
<input type="checkbox" id="chk_tagcloud_show_hidden"/>
<span id="navtab_size_helper_top_2"></span>
<label for="chk_tagcloud_show_hidden">Show hidden (.<i>tag</i>)</label>
<div id="tagcloud_hidden_control_2">
<input type="checkbox" id="chk_tagcloud_show_hidden"/>
<label for="chk_tagcloud_show_hidden">Show hidden (.<i>tag</i>)</label>
</div>
</div>
</div>
<span id="navtab_size_helper_bottom"></span>
</div>
</div>
"""
Expand Down
21 changes: 8 additions & 13 deletions synoptic/static/main.js
Expand Up @@ -1760,23 +1760,18 @@ function add_tag_behavior(jq_result)

function update_tag_cloud_height()
{
var cloud_bottom_offset;
if ($("#navtabs").tabs("option", "selected") == 0)
cloud_bottom_offset = $("#navtab_size_helper_top_1").offset().top;
else
cloud_bottom_offset = $("#navtab_size_helper_top_2").offset().top;

var bottom_size = (
$("#navtab_size_helper_bottom").offset().top
- cloud_bottom_offset);

var tc_height = (
$(window).height()
- $("#subtagcloud").offset().top
- bottom_size
- 50
- $("#logo").height()
- $("#history_nav").height()
- $("#tagtab_header").height()
- $("#tagcloud_hidden_control_1").height()
- 95
);

if (tc_height < 100)
tc_height = 100;

$(".tagcloud").css("max-height", tc_height+"px");
}

Expand Down

0 comments on commit d70ccc0

Please sign in to comment.