Keep the context area in the view if a view scrolls down several pages.

This commit is contained in:
Thomas Keller 2011-06-02 02:04:52 +02:00
parent 592c2ff9ff
commit c0e26133bd
5 changed files with 25 additions and 11 deletions

View File

@ -6,6 +6,7 @@
- File download URLs now contain the file name rather than the upload id; old links still work though (issues 559 and 686) - File download URLs now contain the file name rather than the upload id; old links still work though (issues 559 and 686)
- Display monotone file and directory attributes in the tree and file view - Display monotone file and directory attributes in the tree and file view
(needs a monotone with an interface version of 13.1 or newer) (needs a monotone with an interface version of 13.1 or newer)
- The context area is now kept in view when a page scrolls down several pages
## Bugfixes ## Bugfixes

View File

@ -70,7 +70,6 @@
<div id="ft">{block foot}{/block}</div> <div id="ft">{block foot}{/block}</div>
</div> </div>
{include 'idf/js-hotkeys.html'} {include 'idf/js-hotkeys.html'}
{include 'idf/list-filter.html'}
{block javascript}{/block} {block javascript}{/block}
{if $project} {if $project}
<script type="text/javascript" charset="utf-8">{literal} <script type="text/javascript" charset="utf-8">{literal}

View File

@ -49,7 +49,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="yui-b context">{block context}{/block}</div> <div class="yui-b context" id="context">{block context}{/block}</div>
</div> </div>
<div id="ft">{block foot}{/block}</div> <div id="ft">{block foot}{/block}</div>
</div> </div>

View File

@ -66,7 +66,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="yui-b context">{block context}{/block}</div> <div class="yui-b context" id="context">{block context}{/block}</div>
</div> </div>
<div id="ft">{block foot}{/block}</div> <div id="ft">{block foot}{/block}</div>
</div> </div>
@ -84,6 +84,20 @@ $(document).ready(function(){
else if (frag.length > 3 && frag.substring(0, 3) == '#ic') { else if (frag.length > 3 && frag.substring(0, 3) == '#ic') {
$(frag).addClass("issue-comment-focus"); $(frag).addClass("issue-comment-focus");
} }
var contextTop = $('div#context').position().top;
var contextFixEnabled = true;
$(window).scroll(function() {
if (!contextFixEnabled || $(window).scrollTop() < contextTop)
$('div#context').css('position', 'relative');
else
$('div#context').css('position', 'fixed');
});
$(window).resize(function() {
contextFixEnabled =
$('div#context').offset().top + $('div#context').height() <
$(window).height();
});
}); });
//]]>{/literal} //]]>{/literal}
</script>{/if} </script>{/if}

View File

@ -86,6 +86,14 @@ a.soft:visited {
div.context { div.context {
padding-left: 1em; padding-left: 1em;
position: relative;
top: 0;
}
div.context h3 {
font-size: 13px;
font-weight: bold;
margin: 10px 0 5px;
} }
/** /**
@ -928,14 +936,6 @@ ol > li {
/** /**
* List expander for tag and branch view * List expander for tag and branch view
*/ */
.context {}
.context h3 {
font-size: 13px;
font-weight: bold;
margin: 10px 0 5px;
}
.context > .expander { .context > .expander {
position: relative; position: relative;
overflow: hidden; overflow: hidden;