You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by gr...@apache.org on 2005/02/24 23:41:29 UTC
svn commit: r155267 -
lenya/trunk/src/webapp/lenya/xslt/authoring/edit/form-layout.xsl
Author: gregor
Date: Thu Feb 24 14:41:27 2005
New Revision: 155267
URL: http://svn.apache.org/viewcvs?view=rev&rev=155267
Log:
Made forms editor scroll to editing position after pressing "edit". This fixes http://issues.apache.org/bugzilla/show_bug.cgi?id=33731 (Thanks to Thomas Comiotto for the patch)
Modified:
lenya/trunk/src/webapp/lenya/xslt/authoring/edit/form-layout.xsl
Modified: lenya/trunk/src/webapp/lenya/xslt/authoring/edit/form-layout.xsl
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/xslt/authoring/edit/form-layout.xsl?view=diff&r1=155266&r2=155267
==============================================================================
--- lenya/trunk/src/webapp/lenya/xslt/authoring/edit/form-layout.xsl (original)
+++ lenya/trunk/src/webapp/lenya/xslt/authoring/edit/form-layout.xsl Thu Feb 24 14:41:27 2005
@@ -36,11 +36,9 @@
<page:page>
<page:title>Edit Document</page:title>
<page:body>
-
<div class="lenya-box">
<div class="lenya-box-title">Information</div>
<div class="lenya-box-body">
-
<table class="lenya-table-noborder">
<tr>
<td class="lenya-entry-caption">Document:</td>
@@ -124,6 +122,35 @@
</div>
</div>
+ <xsl:variable name="currentTagID">
+ <xsl:value-of select="substring-before(substring-after($edit, "@tagID='"), "'")"/>
+ </xsl:variable>
+ <xsl:if test="$currentTagID != ''">
+ <script type="text/javascript">
+
+ function addLoadEvent(func) {
+ var oldonload = window.onload;
+ if (typeof window.onload != 'function') {
+ window.onload = func;
+ } else {
+ window.onload = function() {
+ oldonload();
+ func();
+ }
+ }
+ }
+
+ addLoadEvent(goAnchor);
+
+ function goAnchor() {
+ document.location.hash = '<xsl:value-of select="$currentTagID"/>';
+ window.scrollBy(0, -150);
+ }
+ </script>
+ </xsl:if>
+
+
+
</page:body>
</page:page>
</xsl:template>
@@ -225,6 +252,12 @@
<xsl:template match="@select">
<xsl:text> </xsl:text>
<!-- FIXME: Internet Explorer does not send the value of input type equals image. Mozilla does. -->
+
+<xsl:variable name="tagID">
+ <xsl:value-of select="substring-before(substring-after(., "@tagID='"), "'")"/>
+</xsl:variable>
+<xsl:value-of select="@tagID"/>
+<a name="{$tagID}"/>
<input type="image" src="{$imagesPath}/edit.png" name="edit[{.}]" value="{.}"/>
</xsl:template>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org