{"action":"created","issue":{"url":"https://api.github.com/repos/websharks/zencache/issues/574","labels_url":"https://api.github.com/repos/websharks/zencache/issues/574/labels{/name}","comments_url":"https://api.github.com/repos/websharks/zencache/issues/574/comments","events_url":"https://api.github.com/repos/websharks/zencache/issues/574/events","html_url":"https://github.com/websharks/zencache/issues/574","id":108192333,"number":574,"title":"RC Bug :: Cache Stats :: Refresh Broken","user":{"login":"jaswsinc","id":1563559,"avatar_url":"https://avatars.githubusercontent.com/u/1563559?v=3","gravatar_id":"","url":"https://api.github.com/users/jaswsinc","html_url":"https://github.com/jaswsinc","followers_url":"https://api.github.com/users/jaswsinc/followers","following_url":"https://api.github.com/users/jaswsinc/following{/other_user}","gists_url":"https://api.github.com/users/jaswsinc/gists{/gist_id}","starred_url":"https://api.github.com/users/jaswsinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaswsinc/subscriptions","organizations_url":"https://api.github.com/users/jaswsinc/orgs","repos_url":"https://api.github.com/users/jaswsinc/repos","events_url":"https://api.github.com/users/jaswsinc/events{/privacy}","received_events_url":"https://api.github.com/users/jaswsinc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/websharks/zencache/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/websharks/zencache/labels/pro","name":"pro","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/websharks/zencache/milestones/17","html_url":"https://github.com/websharks/zencache/milestones/Next%20Release%20(Pro)","labels_url":"https://api.github.com/repos/websharks/zencache/milestones/17/labels","id":1212166,"number":17,"title":"Next Release (Pro)","description":"Release Candidate by September 19th, 2015\r\nRelease Candidate 2 by September 21st, 2015","creator":{"login":"raamdev","id":53005,"avatar_url":"https://avatars.githubusercontent.com/u/53005?v=3","gravatar_id":"","url":"https://api.github.com/users/raamdev","html_url":"https://github.com/raamdev","followers_url":"https://api.github.com/users/raamdev/followers","following_url":"https://api.github.com/users/raamdev/following{/other_user}","gists_url":"https://api.github.com/users/raamdev/gists{/gist_id}","starred_url":"https://api.github.com/users/raamdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raamdev/subscriptions","organizations_url":"https://api.github.com/users/raamdev/orgs","repos_url":"https://api.github.com/users/raamdev/repos","events_url":"https://api.github.com/users/raamdev/events{/privacy}","received_events_url":"https://api.github.com/users/raamdev/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":19,"state":"open","created_at":"2015-07-17T01:59:07Z","updated_at":"2015-09-24T18:59:50Z","due_on":"2015-09-25T04:00:00Z","closed_at":null},"comments":2,"created_at":"2015-09-24T18:56:55Z","updated_at":"2015-09-24T19:13:05Z","closed_at":null,"body":"## Overview\r\n\r\nhttps://github.com/websharks/zencache-pro/pull/148 introduced a very minor issue related to the \"Refresh\" button for stats. Once the `$chartA` and `$chartB` divs are filled with an `<img />` tag the nested elements are erased, making a refresh not possible; i.e., you need to refresh the entire page instead of being able to click the refresh button.\r\n\r\n## Steps to Reproduce\r\n\r\n- Enable ZenCache Pro RC.\r\n- Visit the \"More Info\" page for stats.\r\n- Test with a fresh install; i.e., no stats available at all.\r\n- Notice that placeholder images exist.\r\n- Hit the front page of the site and let it cache you.\r\n- Without refreshing the entire stats page, click the refresh button.\r\n\r\n## Expected Behavior\r\n\r\nThat it would refresh and show you stats, seeing as how stats now exist after you were cached on the front page of the site.\r\n\r\n## Observed Behavior\r\n\r\nRefresh fails due to the `$chartA` and `$chartB` div children no longer existing. A JavaScript error occurs, which leads to a blank page and failure to refresh the stats.\r\n\r\n![2015-09-24_10-55-27](https://cloud.githubusercontent.com/assets/1563559/10083410/db0f1886-62aa-11e5-9e67-f973581d45f8.png)\r\n"},"comment":{"url":"https://api.github.com/repos/websharks/zencache/issues/comments/143022706","html_url":"https://github.com/websharks/zencache/issues/574#issuecomment-143022706","issue_url":"https://api.github.com/repos/websharks/zencache/issues/574","id":143022706,"user":{"login":"jaswsinc","id":1563559,"avatar_url":"https://avatars.githubusercontent.com/u/1563559?v=3","gravatar_id":"","url":"https://api.github.com/users/jaswsinc","html_url":"https://github.com/jaswsinc","followers_url":"https://api.github.com/users/jaswsinc/followers","following_url":"https://api.github.com/users/jaswsinc/following{/other_user}","gists_url":"https://api.github.com/users/jaswsinc/gists{/gist_id}","starred_url":"https://api.github.com/users/jaswsinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaswsinc/subscriptions","organizations_url":"https://api.github.com/users/jaswsinc/orgs","repos_url":"https://api.github.com/users/jaswsinc/repos","events_url":"https://api.github.com/users/jaswsinc/events{/privacy}","received_events_url":"https://api.github.com/users/jaswsinc/received_events","type":"User","site_admin":false},"created_at":"2015-09-24T19:13:05Z","updated_at":"2015-09-24T19:13:05Z","body":"## Next Actions\r\n\r\n- After [this line](https://github.com/websharks/zencache-pro/blob/000000-dev/src/includes/classes/MenuPageStats.php#L92) add a new empty div placeholder.\r\n\r\n  ```php\r\n  echo '<div class=\"-empty\"></div>'.\"\\n\";\r\n  ```\r\n\r\n  _Repeat for chart B in the same file._\r\n\r\n---\r\n\r\n- Before [this line](https://github.com/websharks/zencache-pro/blob/000000-dev/src/client-s/js/menu-pages.js#L449) add the following:\r\n\r\n  ```js\r\n  $chartA.find('.-heading, .-canvas').hide(), $chartA.find('.-empty').show();\r\n  ```\r\n\r\n  _Repeat for chart B in the same file._\r\n\r\n---\r\n\r\n- Change [this line](https://github.com/websharks/zencache-pro/blob/000000-dev/src/client-s/js/menu-pages.js#L449) to the following:\r\n\r\n  ```js\r\n  $chartA.find('.-empty').html('<img style=\"width:100%;\" src=\"' + plugin.escHtml(plugin.vars.emptyStatsCountsImageUrl) + '\" />');\r\n  ```\r\n\r\n  _Repeat for chart B in the same file._\r\n\r\n---\r\n\r\n- After [this line](https://github.com/websharks/zencache-pro/blob/000000-dev/src/client-s/js/menu-pages.js#L442) add the following:\r\n\r\n  ```js\r\n  $chartA.find('.-heading, .-canvas').show(), $chartA.find('.-empty').hide();\r\n  ```\r\n\r\n  _Repeat for chart B in the same file._\r\n\r\n---\r\n\r\n- **Tip:** While working on this issue you could review the docs for `.find()` here: https://api.jquery.com/find/\r\n- **Tip:** While working on this issue you could review the docs for `.hide()` and `.show()` here:\r\n  - http://api.jquery.com/hide/\r\n  - http://api.jquery.com/show/"}}