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

get_htmlelement_size function returns wrong value

XMLWordPrintable

    • MOODLE_26_STABLE, MOODLE_27_STABLE
    • MOODLE_26_STABLE, MOODLE_27_STABLE
    • wip_MDL-46480_m28_footernan
    • 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)

      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

            skodak Petr Skoda
            oleg Oleg Demeshev
            Simey Lameze Simey Lameze
            Marina Glancy Marina Glancy
            Michael de Raadt Michael de Raadt
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.