Skip to content
This repository has been archived by the owner on Aug 12, 2019. It is now read-only.

Commit

Permalink
fix state being lost if storage did not appear
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikulas committed May 19, 2014
1 parent 153cd68 commit c5e0b60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Tracy/QueryPanel/queryPanel.latte
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
(function() {
var storageRows = document.querySelectorAll('.tracy-queries-overview tr[data-storage-id]');
var queryRows = document.querySelectorAll('.tracy-queries-list tr[data-storage-id]');
var filter = {};
var foreach = function(array, cb) {
for (i = 0; i < array.length; ++i) {
Expand All @@ -101,7 +102,6 @@
};
var updateFilteredRows = function() {
var filter = {};
foreach(storageRows, function(storage, id) {
filter[id] = storage.querySelector('input').checked;
});
Expand Down Expand Up @@ -139,7 +139,7 @@
localStorage.setItem("tracy-queries", JSON.stringify(filter));
};
var loadState = function() {
var filter = JSON.parse(localStorage.getItem("tracy-queries") || "{}");
filter = JSON.parse(localStorage.getItem("tracy-queries") || "{}");
foreach(storageRows, function(storage, id) {
storage.querySelector('input').checked = !(id in filter) || filter[id];
});
Expand Down

0 comments on commit c5e0b60

Please sign in to comment.