Explorar o código

gluon-status-page: don't reset signal graphs on resize events if width hasn't changed

Mobile browsers will often show or hide the address bar while scrolling.
This causes resize events which would often reset the signal graphs.

Fixes #662
Matthias Schiffer %!s(int64=8) %!d(string=hai) anos
pai
achega
48c7039d53
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      package/gluon-status-page/src/js/lib/gui/signalgraph.js

+ 1 - 1
package/gluon-status-page/src/js/lib/gui/signalgraph.js

@@ -110,7 +110,7 @@ define(function () {
     function resize() {
       var newWidth = canvas.parentNode.clientWidth
 
-      if (newWidth === 0)
+      if (newWidth === 0 || newWidth === canvas.width)
         return
 
       var lastImage = ctx.getImageData(0, 0, newWidth, canvas.height)