[Xsltforms-support] Minimal triggers scrolling the page
Brought to you by:
alain-couthures
From: Micah D. <Mic...@ma...> - 2010-01-23 02:09:37
|
Hey Alain, Right now, triggers with appearance="minimal" use an <a href="#"> element, which has the undesirable effect of scrolling the page to the top. The responsible code looks like this: <xsl:template xmlns:xsl="http://www.w3.org/1999/XSL/Transform" match="xforms:trigger|xforms:submit"> <xsl:variable name="innerbody"> <xsl:apply-templates select="xforms:label"> <xsl:with-param name="appearance" select="'span'"/> </xsl:apply-templates> </xsl:variable> <xsl:call-template name="field"> <xsl:with-param name="appearance">none</xsl:with-param> <xsl:with-param name="body"> <xsl:choose> <xsl:when test="@appearance = 'minimal'"> <a href="#"> <xsl:copy-of select="$innerbody"/> </a> </xsl:when> ... Would it be possible to change the minimal trigger (or add a new appearance choice with some name other than 'minimal') to use an href of "javascript:void(0);" or something else that doesn't trigger the scroll effect? For example, adding a new choice like <xsl:choose> <xsl:when test="@appearance = 'minimal'"> <a href="javascript:void(0);"> <xsl:copy-of select="$innerbody"/> </a> </xsl:when> ... What do you think? -m |