Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-46480

get_htmlelement_size function returns wrong value

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      1. Set "Appearance / Theme / Custom CSS":
      #page-footer

      { display: none; }

      2. Set "Site policy URL" and "Site policy URL for quests".

      3. Purge caches

      4. Open /user/policy.php, you should now see the policy content as "iframe" taking all page width and height (it may overlap a bit, the point is it is not invisible any more)

      Show
      1. Set "Appearance / Theme / Custom CSS": #page-footer { display: none; } 2. Set "Site policy URL" and "Site policy URL for quests". 3. Purge caches 4. Open /user/policy.php, you should now see the policy content as "iframe" taking all page width and height (it may overlap a bit, the point is it is not invisible any more)
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      wip_MDL-46480_m28_footernan

      Description

      Under lib/javascrip-static.js, L339, get_htmlelement_size function returns 'NaN' if #page-footer is set to 'display: none'.

      To reproduce:
      1. Set "Appearance / Theme / Custom CSS":
      #page-footer

      { display: none; }

      2. Set "Site policy URL" and "Site policy URL for quests".
      3. Open /user/policy.php, you shouldn't see a policy content, as "iframe" height is set 0.

      The issue with el.getComputedStyle(prop); which returns "auto".

      Solution:
      if (val == 'auto') {
      val = el.getComputedStyle(prop);
      // check val for int
      if (!isNaN(parseInt(val)))

      { val = 0; }

      }
      return parseInt(val);

      Cheers

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                8/Sep/14