Created
May 26, 2019 18:03
-
-
Save ttamg/502f084dfe88d767a8cbab3eef71524e to your computer and use it in GitHub Desktop.
A simple refresh icon that can be added to the navbar at the #refresh id in the DOM. Call needsRefresh() to add the icon.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add refresh app icon | |
function needsRefresh() { | |
$('#refresh').empty(); | |
html = ` | |
<button class="btn" data-toggle="tooltip" title="Click to refresh app"><i data-feather="refresh-cw" onclick="refresh();"></i></button> | |
` | |
$('#refresh').append(html); | |
$('[data-toggle="tooltip"]').tooltip() | |
feather.replace() | |
} | |
// Refresh the app | |
function refresh() { | |
$('#refresh').empty(); | |
location.reload(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment