Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-20319

iPhone-specific code is causing pages in all browsers to scroll to top

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Fix
    • Medium
    • None
    • 3.2
    • None

    Description

      When trying to create a link to an anchor on a page I noticed some very strange behavior. The page would initially be positioned at the anchor, but would immediately scroll back to the top of the page. After some digging I found that this seems to be related to iPhone support.

      In the page content there is this script:

      <!-- start iPhone javascripts --><script type="text/javascript">
      addLoadEvent(function()

      { setTimeout(hideAddressBar, 0); }

      );</script>
      <!-- end iPhone javascripts -->

      And addLoadEvent is defined in .../s/1810/1/_/download/resources/com.atlassian.confluence.plugins.iphone/iphone.js:

      /* Hides the scroll bar */
      function hideAddressBar()

      { window.scrollTo(0, 1); }

      /* Runs some onload initialize logic. There isn't anything here at the moment, but this is where
      logic to tidy up the dashboard might go*/
      function initializeIphone() {

      }

      /* Adds onload functions */
      function addLoadEvent(func) {
      var oldonload = window.onload;
      if (typeof window.onload != 'function')

      { window.onload = func; }

      else {
      window.onload = function() {
      if (oldonload)

      { oldonload(); }

      func();
      }
      }
      }

      This code seem to be present and execute on a number of browsers that I've tested: Firefox 3.6, Safari 5.0 and Chrome 6.0 (all Mac OS X 10.6)

      Attachments

        Activity

          People

            Unassigned Unassigned
            432605ddc32d Tim Pesce
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: