Fix the case where someone tries the tour with an unsupported browser
This commit is contained in:
		
							parent
							
								
									9d1ae8ba87
								
							
						
					
					
						commit
						2bf12996f5
					
				
					 2 changed files with 11 additions and 1 deletions
				
			
		|  | @ -32,6 +32,8 @@ angular.module("angular-tour", []) | |||
|         'inline': '=inline', | ||||
|       }, | ||||
|       controller: function($rootScope, $scope, $element, $location, $interval, AngularTour) { | ||||
|         $scope.supported = !!window.EventSource; | ||||
| 
 | ||||
|         var createNewScope = function(initialScope) { | ||||
|           var tourScope = jQuery.extend({}, initialScope || {}); | ||||
|           tourScope['_replaceData'] = function(s) { | ||||
|  | @ -264,6 +266,10 @@ angular.module("angular-tour", []) | |||
|       checker.$message = null; | ||||
| 
 | ||||
|       checker.$setup = function(tourScope) { | ||||
|         if (!window.EventSource) { | ||||
|           return; | ||||
|         } | ||||
| 
 | ||||
|         var fullUrl = tourScope._replaceData(url); | ||||
|         checker.$source = new EventSource(fullUrl); | ||||
|         checker.$source.onmessage = function(e) { | ||||
|  |  | |||
		Reference in a new issue