Fixed issue 221, scroll to the preview if exists.

This commit is contained in:
Mehdi Kabab 2009-05-26 11:48:02 +02:00 committed by Loic d'Anterroches
parent 2c9cf96245
commit 3476541bf4
6 changed files with 22 additions and 16 deletions

View File

@ -73,15 +73,18 @@
{include 'idf/js-hotkeys.html'}
{block javascript}{/block}
{if $project}
<script type="text/javascript">{literal}
<!-- //
<script type="text/javascript" charset="utf-8">{literal}
//<![CDATA[
$(document).ready(function(){
var frag = location.hash;
if (frag.length > 3 && frag.substring(0, 3) == '#ic') {
if ($('#preview').length) {
location.hash = '#preview';
}
else if (frag.length > 3 && frag.substring(0, 3) == '#ic') {
$(frag).addClass("issue-comment-focus");
}
});
// -->{/literal}
//]]>{/literal}
</script>{/if}
</body>
</html>

View File

@ -75,15 +75,18 @@
{include 'idf/js-hotkeys.html'}
{block javascript}{/block}
{if $project}
<script type="text/javascript">{literal}
<!-- //
<script type="text/javascript" charset="utf-8">{literal}
//<![CDATA[
$(document).ready(function(){
var frag = location.hash;
if (frag.length > 3 && frag.substring(0, 3) == '#ic') {
if ($('#preview').length) {
location.hash = '#preview';
}
else if (frag.length > 3 && frag.substring(0, 3) == '#ic') {
$(frag).addClass("issue-comment-focus");
}
});
// -->{/literal}
//]]>{/literal}
</script>{/if}
</body>
</html>

View File

@ -11,14 +11,14 @@
{/if}
{if $preview}
<h2 class="top">{trans 'Preview'}</h2>
<h2 id="preview" class="top">{trans 'Preview'}</h2>
<div class="issue-comment issue-comment-first issue-comment-last">
<br /><pre class="issue-comment-text">{issuetext $preview, $request}</pre>
</div>
<hr />
{/if}
<form method="post" enctype="multipart/form-data" action="{url 'IDF_Views_Issue::create', array($project.shortname)}" >
<form method="post" enctype="multipart/form-data" action="{url 'IDF_Views_Issue::create', array($project.shortname)}#preview" >
<table class="form" summary="">
<tr>
<th><strong>{$form.f.summary.labelTag}:</strong></th>

View File

@ -53,7 +53,7 @@
{/if}
{if $preview}
<h2>{trans 'Preview'}</h2>
<h2 id="preview">{trans 'Preview'}</h2>
<div class="issue-comment issue-comment-first issue-comment-last">
<br /><pre class="issue-comment-text">{issuetext $preview, $request}</pre>
</div>

View File

@ -3,7 +3,7 @@
{block body}
{if $preview}
<h2 class="top">{trans 'Preview of the Page'}</h2>
<h2 id="preview" class="top">{trans 'Preview of the Page'}</h2>
{markdown $preview, $request}
{/if}

View File

@ -3,7 +3,7 @@
{block body}
{if $preview}
<h2 class="top">{trans 'Preview of the Page'}</h2>
<h2 id="preview" class="top">{trans 'Preview of the Page'}</h2>
{markdown $preview, $request}
{/if}