Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. function MapCtrl($scope) {
  2.  
  3. if(navigator.onLine){
  4. $scope.online = true;
  5. } else {
  6. $scope.offline = true;
  7. }
  8.  
  9. /* text */
  10. $scope.reloadText = "Reload";
  11. $scope.reloadingText = "Reload in progress";
  12. $scope.offlineText = "not online";
  13.  
  14.  
  15. $scope.reloadMap = function() {
  16. $scope.reload = true;
  17. $scope.online = false;
  18. $scope.offline = false;
  19. }
  20. }
  21.  
  22. <section class="myPanel panel-padding" ng-controller="MapCtrl">
  23.  
  24. <div id="myMap">
  25. <div class="alert alert-danger" ng-show="offline">{{offlineText}}</div>
  26.  
  27. <p ng-show="reload"><i class="fa fa-refresh fa-spin"></i> <span>{{reloadingText}}</span></p>
  28.  
  29. <div id="map" ng-show="online"></div>
  30. <div id="mapControls">
  31. <ul>
  32. <li ng-hide="reload">
  33. <button type="button" ng-click="reloadMap()" class="btn btn-primary btn-xs">{{reloadText}}</button>
  34. </li>
  35. </ul>
  36. </div>
  37. </div>
  38. </section>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement