Fix the case where someone tries the tour with an unsupported browser

This commit is contained in:
Joseph Schorr 2014-06-16 14:05:27 -04:00
parent 9d1ae8ba87
commit 2bf12996f5
2 changed files with 11 additions and 1 deletions

View file

@ -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) {