Fixed issue 221, scroll to the preview if exists.

master
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'} {include 'idf/js-hotkeys.html'}
{block javascript}{/block} {block javascript}{/block}
{if $project} {if $project}
<script type="text/javascript">{literal} <script type="text/javascript" charset="utf-8">{literal}
<!-- // //<![CDATA[
$(document).ready(function(){ $(document).ready(function(){
var frag = location.hash; 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"); $(frag).addClass("issue-comment-focus");
} }
}); });
// -->{/literal} //]]>{/literal}
</script>{/if} </script>{/if}
</body> </body>
</html> </html>

View File

@ -75,15 +75,18 @@
{include 'idf/js-hotkeys.html'} {include 'idf/js-hotkeys.html'}
{block javascript}{/block} {block javascript}{/block}
{if $project} {if $project}
<script type="text/javascript">{literal} <script type="text/javascript" charset="utf-8">{literal}
<!-- // //<![CDATA[
$(document).ready(function(){ $(document).ready(function(){
var frag = location.hash; 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"); $(frag).addClass("issue-comment-focus");
} }
}); });
// -->{/literal} //]]>{/literal}
</script>{/if} </script>{/if}
</body> </body>
</html> </html>

View File

@ -11,14 +11,14 @@
{/if} {/if}
{if $preview} {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"> <div class="issue-comment issue-comment-first issue-comment-last">
<br /><pre class="issue-comment-text">{issuetext $preview, $request}</pre> <br /><pre class="issue-comment-text">{issuetext $preview, $request}</pre>
</div> </div>
<hr /> <hr />
{/if} {/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=""> <table class="form" summary="">
<tr> <tr>
<th><strong>{$form.f.summary.labelTag}:</strong></th> <th><strong>{$form.f.summary.labelTag}:</strong></th>

View File

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

View File

@ -3,7 +3,7 @@
{block body} {block body}
{if $preview} {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} {markdown $preview, $request}
{/if} {/if}

View File

@ -3,7 +3,7 @@
{block body} {block body}
{if $preview} {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} {markdown $preview, $request}
{/if} {/if}