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
|
@ -6,7 +6,11 @@
|
||||||
<button type="button" class="close" ng-click="stop()" aria-hidden="true">×</button>
|
<button type="button" class="close" ng-click="stop()" aria-hidden="true">×</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tour-contents">
|
<div class="tour-contents" ng-show="!supported">
|
||||||
|
Your browser does not support features required for this tour. Please upgrade and try again.
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="tour-contents" ng-show="supported">
|
||||||
<div class="step-title" ng-shpw="step.title">{{ step.title }}</div>
|
<div class="step-title" ng-shpw="step.title">{{ step.title }}</div>
|
||||||
<div class="slide-animate-container">
|
<div class="slide-animate-container">
|
||||||
<div class="step-content" ng-show="step.content" ng-bind-html="step.content || ''"></div>
|
<div class="step-content" ng-show="step.content" ng-bind-html="step.content || ''"></div>
|
||||||
|
|
|
@ -32,6 +32,8 @@ angular.module("angular-tour", [])
|
||||||
'inline': '=inline',
|
'inline': '=inline',
|
||||||
},
|
},
|
||||||
controller: function($rootScope, $scope, $element, $location, $interval, AngularTour) {
|
controller: function($rootScope, $scope, $element, $location, $interval, AngularTour) {
|
||||||
|
$scope.supported = !!window.EventSource;
|
||||||
|
|
||||||
var createNewScope = function(initialScope) {
|
var createNewScope = function(initialScope) {
|
||||||
var tourScope = jQuery.extend({}, initialScope || {});
|
var tourScope = jQuery.extend({}, initialScope || {});
|
||||||
tourScope['_replaceData'] = function(s) {
|
tourScope['_replaceData'] = function(s) {
|
||||||
|
@ -264,6 +266,10 @@ angular.module("angular-tour", [])
|
||||||
checker.$message = null;
|
checker.$message = null;
|
||||||
|
|
||||||
checker.$setup = function(tourScope) {
|
checker.$setup = function(tourScope) {
|
||||||
|
if (!window.EventSource) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var fullUrl = tourScope._replaceData(url);
|
var fullUrl = tourScope._replaceData(url);
|
||||||
checker.$source = new EventSource(fullUrl);
|
checker.$source = new EventSource(fullUrl);
|
||||||
checker.$source.onmessage = function(e) {
|
checker.$source.onmessage = function(e) {
|
||||||
|
|
Reference in a new issue