feat(tour): esc force closes, but puts justin head in toolbar. clicking

justin head brings tour back.
This commit is contained in:
Tyler Renelle
2015-03-24 15:41:02 -06:00
parent 4c3ad2f705
commit 560d51b2e2
8 changed files with 378 additions and 377 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 503 KiB

After

Width:  |  Height:  |  Size: 503 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 794 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@@ -229,7 +229,7 @@ function($rootScope, User, $timeout, $state) {
if (!updateFn) return; // only run after user has been wrapped
watcher(); // deregister watcher
if (window.env.IS_MOBILE) return; // Don't show tour immediately on mobile devices
goto('intro', User.user.flags.tour.intro, true);
goto('intro', 0); // kick off first step on first visit
var alreadyShown = function(before, after) { return !(!before && after === true) };
//$rootScope.$watch('user.flags.dropsEnabled', _.flow(alreadyShown, function(already) { //FIXME requires lodash@~3.2.0
@@ -256,14 +256,10 @@ function($rootScope, User, $timeout, $state) {
});
});
$(document).on("keyup.tour-intro", function(e) {
if (e.which == 27) {
return User.set({'flags.tour.intro':-2});
}
})
return {
var Guide = {
goto: goto
};
$rootScope.Guide = Guide;
return Guide;
}]);

View File

@@ -121,7 +121,7 @@ var UserSchema = new Schema({
showTour: {type: Boolean, 'default': true},
tour: {
// -1 indicates "uninitiated", -2 means "complete", any other number is the current tour step (0-index)
intro: {type: Number, 'default': 0},
intro: {type: Number, 'default': -1},
classes: {type: Number, 'default': -1},
stats: {type: Number, 'default': -1},
tavern: {type: Number, 'default': -1},

View File

@@ -269,6 +269,11 @@ nav.toolbar(ng-controller='AuthCtrl', ng-class='{active: isToolbarHidden}')
li.toolbar-currency.silver(popover=env.t('silver'), popover-placement='bottom',popover-trigger='mouseenter')
span.shop_silver
span {{Shared.silver(user.stats.gp)}}
ul.toolbar-bailey(ng-class='{inactive: !_expandedMenu}')
li.toolbar-bailey-container(ng-if='user.flags.tour.intro!=-2')
.npc_justin_head.npc_bailey_head(popover="Continue Tour", popover-trigger='mouseenter', popover-placement='bottom', ng-click='Guide.goto("intro", user.flags.tour.intro, true)')
ul.toolbar-bailey(ng-class='{inactive: !_expandedMenu}')
li.toolbar-bailey-container(ng-if='user.flags.newStuff')
.npc_bailey.npc_bailey_head(popover=env.t('psst'), popover-trigger='mouseenter', popover-placement='right', ng-click='openModal("newStuff",{size:"lg"})')