Last active
January 2, 2016 04:19
-
-
Save dillongreen/8249758 to your computer and use it in GitHub Desktop.
meteor template helper for client connection status template seen at https://gist.github.com/8249761
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
Template.navbar.connection_status = function () { | |
var connection_status = Meteor.status().status; | |
var retryCount = Meteor.status().retryCount; | |
switch(connection_status){ | |
case "connected": | |
return { label: "label-success", | |
connection_status: connection_status}; | |
case "waiting": | |
return { label: "label-warning", | |
connection_status: connection_status, | |
retryCount: retryCount}; | |
case "connecting": | |
return { label: "label-info", | |
connection_status: connection_status}; | |
case "failed": | |
return { label: "label-danger", | |
connection_status: connection_status}; | |
case "offline": | |
return { label: "label-default", | |
connection_status: connection_status}; | |
} | |
return null; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment