Commit b3fc275d authored by Todd E Brandt's avatar Todd E Brandt Committed by Rafael J. Wysocki

AnalyzeSuspend: fix drag and zoom bug in javascript

Signed-off-by: default avatarTodd Brandt <todd.e.brandt@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 03bc39be
...@@ -3846,6 +3846,7 @@ def addScriptCode(hf, testruns): ...@@ -3846,6 +3846,7 @@ def addScriptCode(hf, testruns):
' function zoomTimeline() {\n'\ ' function zoomTimeline() {\n'\
' var dmesg = document.getElementById("dmesg");\n'\ ' var dmesg = document.getElementById("dmesg");\n'\
' var zoombox = document.getElementById("dmesgzoombox");\n'\ ' var zoombox = document.getElementById("dmesgzoombox");\n'\
' var left = zoombox.scrollLeft;\n'\
' var val = parseFloat(dmesg.style.width);\n'\ ' var val = parseFloat(dmesg.style.width);\n'\
' var newval = 100;\n'\ ' var newval = 100;\n'\
' var sh = window.outerWidth / 2;\n'\ ' var sh = window.outerWidth / 2;\n'\
...@@ -3853,12 +3854,12 @@ def addScriptCode(hf, testruns): ...@@ -3853,12 +3854,12 @@ def addScriptCode(hf, testruns):
' newval = val * 1.2;\n'\ ' newval = val * 1.2;\n'\
' if(newval > 910034) newval = 910034;\n'\ ' if(newval > 910034) newval = 910034;\n'\
' dmesg.style.width = newval+"%";\n'\ ' dmesg.style.width = newval+"%";\n'\
' zoombox.scrollLeft = ((zoombox.scrollLeft + sh) * newval / val) - sh;\n'\ ' zoombox.scrollLeft = ((left + sh) * newval / val) - sh;\n'\
' } else if (this.id == "zoomout") {\n'\ ' } else if (this.id == "zoomout") {\n'\
' newval = val / 1.2;\n'\ ' newval = val / 1.2;\n'\
' if(newval < 100) newval = 100;\n'\ ' if(newval < 100) newval = 100;\n'\
' dmesg.style.width = newval+"%";\n'\ ' dmesg.style.width = newval+"%";\n'\
' zoombox.scrollLeft = ((zoombox.scrollLeft + sh) * newval / val) - sh;\n'\ ' zoombox.scrollLeft = ((left + sh) * newval / val) - sh;\n'\
' } else {\n'\ ' } else {\n'\
' zoombox.scrollLeft = 0;\n'\ ' zoombox.scrollLeft = 0;\n'\
' dmesg.style.width = "100%";\n'\ ' dmesg.style.width = "100%";\n'\
...@@ -4068,7 +4069,7 @@ def addScriptCode(hf, testruns): ...@@ -4068,7 +4069,7 @@ def addScriptCode(hf, testruns):
' window.addEventListener("load", function () {\n'\ ' window.addEventListener("load", function () {\n'\
' var dmesg = document.getElementById("dmesg");\n'\ ' var dmesg = document.getElementById("dmesg");\n'\
' dmesg.style.width = "100%"\n'\ ' dmesg.style.width = "100%"\n'\
' document.onmousedown = onMouseDown;\n'\ ' dmesg.onmousedown = onMouseDown;\n'\
' document.onmouseup = onMouseUp;\n'\ ' document.onmouseup = onMouseUp;\n'\
' document.onkeypress = onKeyPress;\n'\ ' document.onkeypress = onKeyPress;\n'\
' document.getElementById("zoomin").onclick = zoomTimeline;\n'\ ' document.getElementById("zoomin").onclick = zoomTimeline;\n'\
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment