Skip to content

Commit b5cf63b

Browse files
committed
fix alert color issues
1 parent d34e3d0 commit b5cf63b

File tree

20 files changed

+44
-51
lines changed

20 files changed

+44
-51
lines changed

lib/actions/page.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ exports.pageNext = pageNext;
1818
function pageSet(pagePosition) {
1919
if (pagePosition === void 0) { pagePosition = 0; }
2020
return function (dispatch, getState) {
21-
var _a = getState(), dir = _a.dir, progress = _a.progress, tutorial = _a.tutorial;
22-
var tasks = tutorial.pages[pagePosition].tasks || [];
21+
var _a = getState(), dir = _a.dir, progress = _a.progress, tutorial = _a.tutorial, route = _a.route;
22+
console.log(pagePosition, dir, progress, tutorial, route);
2323
if (pagePosition >= progress.pages.length) {
2424
dispatch({ type: _types_1.ROUTE_SET, payload: { route: 'final' } });
2525
}
26+
dispatch(hint_1.hintPositionSet(0));
27+
var tasks = tutorial.pages[pagePosition].tasks || [];
2628
dispatch({
2729
type: _types_1.PAGE_SET, payload: { dir: dir, pagePosition: pagePosition, tutorial: tutorial, progress: progress, tasks: tasks }
2830
});
29-
dispatch(hint_1.hintPositionSet(0));
3031
};
3132
}
3233
exports.pageSet = pageSet;

lib/components/AppMenu/Quit/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ var Quit = (function (_super) {
3232
Quit = __decorate([
3333
react_redux_1.connect(null, function (dispatch) {
3434
return {
35-
quit: function () {
36-
dispatch(actions_1.quit());
37-
}
35+
quit: function () { return dispatch(actions_1.quit()); }
3836
};
3937
}),
4038
__metadata('design:paramtypes', [])

lib/components/Common/RouteButton.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
1515
};
1616
var React = require('react');
1717
var react_redux_1 = require('react-redux');
18-
var actions_1 = require('../../actions');
1918
var RaisedButton_1 = require('material-ui/RaisedButton');
19+
var actions_1 = require('../../actions');
2020
var RouteButton = (function (_super) {
2121
__extends(RouteButton, _super);
2222
function RouteButton() {
@@ -29,7 +29,7 @@ var RouteButton = (function (_super) {
2929
RouteButton = __decorate([
3030
react_redux_1.connect(null, function (dispatch) {
3131
return {
32-
routeTo: function (route) { return dispatch(actions_1.routeSet(route)); },
32+
routeTo: function (route) { return dispatch(actions_1.routeSet(route)); }
3333
};
3434
}),
3535
__metadata('design:paramtypes', [])

lib/components/Page/PageToolbar/Continue/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var RaisedButton_1 = require('material-ui/RaisedButton');
1919
var actions_1 = require('../../../../actions');
2020
var styles = {
2121
zIndex: '10000',
22-
border: '0',
22+
border: '0px',
2323
boxShadow: 'none',
2424
backgroundColor: 'inherit',
2525
position: 'relative',
@@ -36,9 +36,7 @@ var Continue = (function (_super) {
3636
Continue = __decorate([
3737
react_redux_1.connect(null, function (dispatch, state) {
3838
return {
39-
callNextPage: function () {
40-
dispatch(actions_1.pageNext());
41-
}
39+
callNextPage: function () { return dispatch(actions_1.pageNext()); }
4240
};
4341
}),
4442
__metadata('design:paramtypes', [])

lib/components/Page/PageToolbar/Save/index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var react_redux_1 = require('react-redux');
1818
var RaisedButton_1 = require('material-ui/RaisedButton');
1919
var actions_1 = require('../../../../actions');
2020
var styles = {
21-
border: '0',
21+
border: '0px',
2222
boxShadow: 'none',
2323
backgroundColor: 'inherit',
2424
position: 'relative',
@@ -35,9 +35,7 @@ var Save = (function (_super) {
3535
Save = __decorate([
3636
react_redux_1.connect(null, function (dispatch, state) {
3737
return {
38-
save: function () {
39-
dispatch(actions_1.testSave());
40-
}
38+
save: function () { return dispatch(actions_1.testSave()); }
4139
};
4240
}),
4341
__metadata('design:paramtypes', [])

lib/components/Page/PageToolbar/ToggleLog/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ var ToggleLog = (function (_super) {
3434
ToggleLog = __decorate([
3535
react_redux_1.connect(null, function (dispatch, state) {
3636
return {
37-
toggleDevTools: function () {
38-
dispatch(actions_1.devToolsToggle());
39-
}
37+
toggleDevTools: function () { return dispatch(actions_1.devToolsToggle()); }
4038
};
4139
}),
4240
__metadata('design:paramtypes', [])

lib/reducers/alert/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ function setAlert(a) {
2121
var color = colors[a.action] || colors.NOTE;
2222
var statusBarAlert = document.getElementsByClassName('cr-alert-replay')[0];
2323
statusBarAlert.style.color = color;
24+
current = a;
2425
return Object.assign({}, open, a);
2526
}
2627
function alertReducer(alert, action) {

src/actions/page.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import {
2-
ROUTE_SET, PAGE_SET, PAGE_POSITION_SET
2+
ROUTE_SET, PAGE_SET
33
} from './_types';
44
import {hintPositionSet} from './hint';
5+
import {routeSet} from './route';
56

67
export function pageNext(): ReduxThunk.ThunkInterface | Action {
78
return (dispatch, getState): void => {
@@ -18,15 +19,18 @@ export function pageNext(): ReduxThunk.ThunkInterface | Action {
1819

1920
export function pageSet(pagePosition = 0): ReduxThunk.ThunkInterface {
2021
return (dispatch, getState): void => {
21-
const {dir, progress, tutorial} = getState();
22-
// create absolute paths for 'task-tests'
23-
const tasks = tutorial.pages[pagePosition].tasks || [];
22+
const {dir, progress, tutorial, route} = getState();
23+
console.log(pagePosition, dir, progress, tutorial, route);
24+
25+
// routes
2426
if (pagePosition >= progress.pages.length) {
2527
dispatch({ type: ROUTE_SET, payload: { route: 'final' } });
2628
}
29+
dispatch(hintPositionSet(0));
30+
// create absolute paths for 'task-tests'
31+
const tasks = tutorial.pages[pagePosition].tasks || [];
2732
dispatch({
2833
type: PAGE_SET, payload: { dir, pagePosition, tutorial, progress, tasks }
2934
});
30-
dispatch(hintPositionSet(0));
3135
};
3236
}

src/actions/progress.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import {alertOpen} from './alert';
55
import {testRun} from './test';
66

77
export function progressPagePositionLoad(): ReduxThunk.ThunkInterface {
8-
return (dispatch, getState): void => {
8+
return (dispatch, getState) => {
99
const {progress} = getState();
1010
dispatch({ type: PROGRESS_PAGE_POSITION_LOAD, payload: { progress } });
1111
};
1212
}
1313

1414
export function progressLoad(): ReduxThunk.ThunkInterface {
15-
return (dispatch, getState): void => {
15+
return (dispatch, getState) => {
1616
const {tutorial} = getState();
1717
dispatch({ type: PROGRESS_LOAD, payload: { tutorial } });
1818
// call pagePositionLoad after progress loads
@@ -22,7 +22,7 @@ export function progressLoad(): ReduxThunk.ThunkInterface {
2222
}
2323

2424
export function completePage(completed = true): ReduxThunk.ThunkInterface {
25-
return (dispatch, getState): void => {
25+
return (dispatch, getState) => {
2626
const {pagePosition, progress, tutorial} = getState();
2727
// all pages are true, tutorial complete
2828
dispatch({ type: COMPLETE_PAGE, payload: { pagePosition, tutorial, completed } });
@@ -42,7 +42,7 @@ export function completePage(completed = true): ReduxThunk.ThunkInterface {
4242
}
4343

4444
export function completeTutorial(completed = true): ReduxThunk.ThunkInterface {
45-
return (dispatch, getState): void => {
45+
return (dispatch, getState) => {
4646
const {tutorial} = getState();
4747
dispatch({ type: COMPLETE_TUTORIAL, payload: { tutorial, completed } });
4848
dispatch(alertOpen({

src/actions/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let previous = null;
66
/* Navigation */
77
export function routeSet(route: string): ReduxThunk.ThunkInterface {
88
if (route && route !== previous) {
9-
return (dispatch): void => {
9+
return (dispatch) => {
1010
// preloading for routes
1111
switch (route) {
1212
case 'tutorials':

0 commit comments

Comments
 (0)