Project

General

Profile

Bug #7804

System info widget CPU usage not updating in IE. Needs Math.trunc() polyfill.

Added by NOYB NOYB 4 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Web Interface
Target version:
Start date:
08/23/2017
Due date:
% Done:

100%

Affected Version:
2.4
Affected Architecture:

Description

System info widget CPU usage not updating in IE. Needs Math.trunc() polyfill.

Also affected versions:
2.3.4 (gitsync), 2.3.5 (2.3)
2.4.0, 2.4.1 (2.4)

/usr/local/www/js/polyfills.js

/***
** 
** Polyfill for older browsers that don't yet have the newer "Math.trunc()" function implemented.
** Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc#Polyfill
** Documentation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc
** 
***/

Math.trunc = Math.trunc || function(x) {
  if (isNaN(x)) {
    return NaN;
  }
  if (x > 0) {
    return Math.floor(x);
  }
  return Math.ceil(x);
};

Associated revisions

Revision ab5a3fa1
Added by Steve Beaver 4 months ago

Fixed #7804
Replace Math.trunc with Math.floor to make IE happy

Revision 113caa09
Added by Steve Beaver 4 months ago

Fixed #7804
Replace Math.trunc with Math.floor to make IE happy

(cherry picked from commit ab5a3fa10e8dd2b88219a00ac410cb9ea8a0b5aa)

Revision a1c3244c
Added by Steve Beaver 4 months ago

Fixed #7804 Replace Math.trunc with Math.floor to make IE happy

Revision f82af17a
Added by Steve Beaver 4 months ago

Fixed #7804 Replace Math.trunc with Math.floor to make IE happy

(cherry picked from commit a1c3244c96b033891136ff2d95be61500a720231)

History

#1 Updated by Steve Beaver 4 months ago

  • Assignee set to Steve Beaver
  • Target version set to 2.4.0

#2 Updated by Steve Beaver 4 months ago

polyfill.js is included by foot.inc so should be available. I will attempt to reproduce. Which version of IE are you using?

Since the value in question can never be negative though, it is probably easier to just use Math.floor rather than Math.trunc

#3 Updated by Steve Beaver 4 months ago

  • Status changed from New to Feedback

#4 Updated by Steve Beaver 4 months ago

  • % Done changed from 0 to 100

#5 Updated by Bart K 4 months ago

IE 11.540 issue still present. "Retrieving CPU data" spinning gear.

#6 Updated by Steve Beaver 4 months ago

Need to wait for the next snap. The fix has been applied but not built yet.

#7 Updated by Jim Pingle 3 months ago

  • Status changed from Feedback to Resolved

Works in IE now

Also available in: Atom PDF