Changeset 32666 for main


Ignore:
Timestamp:
2018-12-10T13:15:41+13:00 (5 years ago)
Author:
kjdon
Message:

when viewing an image with zoom enabled, and the image doesn't fit into the space beside the sidebar box, then the image moves underneath. Fine, except that the divs for the zoom functionality don't move with it. The next seciton title ends up underneath the image, and the zooming thing doesn't line up with the actual image. Added javascript to put a div style=clear:both; before the image if its needed. This moved everything down underneath the side bar.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl

    r32627 r32666  
    554554
    555555        <xsl:choose>
    556             <xsl:when test="metadataList/metadata[@name = 'Screen'] and metadataList/metadata[@name = 'SourceFile'] and ($imageWidth div $screenImageWidth > 1.2) and (not(/page/pageResponse/format[@type='display']/gsf:option[@name='disableZoom']) or /page/pageResponse/format[@type='display']/gsf:option[@name='disableZoom']/@value='false')">
     556          <xsl:when test="metadataList/metadata[@name = 'Screen'] and metadataList/metadata[@name = 'SourceFile'] and ($imageWidth div $screenImageWidth > 1.2) and (not(/page/pageResponse/format[@type='display']/gsf:option[@name='disableZoom']) or /page/pageResponse/format[@type='display']/gsf:option[@name='disableZoom']/@value='false')">
     557            <div id="tidyDiv"/>
     558            <!-- adding a div with clear:both when the image doesn't nicely fit in beside the side bar. Otherwise, the divs stays up, but the image moves down and everything looks and acts weird. -->
     559            <script type="text/javascript">
     560              <xsl:text disable-output-escaping="yes">
     561           
     562            var containerWidth = document.getElementById("container").offsetWidth;
     563            var sidebarWidth = document.getElementById("rightSidebar").offsetWidth;
     564            if (containerWidth - sidebarWidth &lt; </xsl:text><xsl:value-of select="$screenImageWidth"/><xsl:text disable-output-escaping="yes">) {
     565              $("#tidyDiv").css("clear", "both");
     566            }
     567              </xsl:text>
     568            </script>
    557569                <div id="image{@nodeID}">
    558570                  <!-- when we ask for an individual section content we set ed=1. putting this test here prevents downloading all the screen and full images for each section of the document when we are just looking at the contents list. ed is not set for simple docs, so do this if doctype is simple -->
Note: See TracChangeset for help on using the changeset viewer.