Skip to content

Commit 353c0e3

Browse files
committed
apply code suggestion - make use of the historyLoad variable
1 parent 65464cd commit 353c0e3

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

system/Debug/Toolbar/Views/toolbar.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,25 @@ var ciDebugBar = {
2727
.getElementById("debug-icon-link")
2828
.addEventListener("click", ciDebugBar.toggleToolbar, true);
2929

30-
if (this.toolbar.querySelector(".ci-history-load")) {
30+
historyLoad = this.toolbar.getElementsByClassName("ci-history-load");
31+
32+
if (historyLoad.length) {
3133
// Allows highlighting the row of the current history request
3234
var btn = this.toolbar.querySelector(
33-
'button[data-time="' + localStorage.getItem("debugbar-time") + '"]'
35+
'button[data-time="' + localStorage.getItem("debugbar-time-new") + '"]'
3436
);
3537
ciDebugBar.addClass(btn.parentNode.parentNode, "current");
36-
}
3738

38-
historyLoad = this.toolbar.getElementsByClassName("ci-history-load");
3939

40-
for (var i = 0; i < historyLoad.length; i++) {
41-
historyLoad[i].addEventListener(
42-
"click",
43-
function () {
44-
loadDoc(this.getAttribute("data-time"));
45-
},
46-
true
47-
);
40+
for (var i = 0; i < historyLoad.length; i++) {
41+
historyLoad[i].addEventListener(
42+
"click",
43+
function () {
44+
loadDoc(this.getAttribute("data-time"));
45+
},
46+
true
47+
);
48+
}
4849
}
4950

5051
// Display the active Tab on page load

0 commit comments

Comments
 (0)