From 80d30b9c5ed7cc5c22fec7c296bb9223e429400f Mon Sep 17 00:00:00 2001 From: Sri Rudra Tetali Date: Wed, 16 Oct 2019 00:20:31 +0530 Subject: [PATCH] #61 Implement Refresh button for this issue --- docs/js/index.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/js/index.js b/docs/js/index.js index d066bc7..c52d049 100644 --- a/docs/js/index.js +++ b/docs/js/index.js @@ -11,6 +11,12 @@ function clearContributor() { contributor.innerHTML = ""; } +if(typeof(Storage) !== "undefined") { + if(sessionStorage && sessionStorage.isRefreshButtonClicked){ + document.getElementsByClassName('button-main')[4].style.backgroundColor = 'yellow'; + } +} + clearContributor(); for (var i = 0; i < columns.length; i++) { @@ -74,3 +80,11 @@ document.getElementsByClassName('button-main')[3].addEventListener('click', func }) }); }) + +document.getElementsByClassName('button-main')[4].addEventListener('click', function () { + this.style.backgroundColor = 'yellow'; + if(typeof(Storage) !== "undefined") { + sessionStorage.isRefreshButtonClicked = true; + document.location.reload(); + } +})