Skip to content

Commit 47470eb

Browse files
committed
minor fixes
1 parent 1204130 commit 47470eb

File tree

10 files changed

+1704
-1684
lines changed

10 files changed

+1704
-1684
lines changed

lib/components/progress/progress.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
'use strict';
1+
"use strict";
22
var __extends = (this && this.__extends) || function (d, b) {
33
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
44
function __() { this.constructor = d; }
@@ -41,7 +41,10 @@ var ProgressPage = (function (_super) {
4141
}
4242
};
4343
ProgressPage.prototype.canActivate = function (isActive, itemPosition, position) {
44-
if (isActive && itemPosition.chapter <= position.chapter && itemPosition.page <= position.page) {
44+
var earlierChapter = itemPosition.chapter < position.chapter;
45+
var currentChapter = itemPosition.chapter = position.chapter;
46+
var earlierOrCurrentPage = itemPosition.page <= position.page;
47+
if (isActive || earlierChapter || (currentChapter && earlierOrCurrentPage)) {
4548
return true;
4649
}
4750
else {

lib/services/exists.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ function fileExists(pathToFile) {
66
}
77
catch (e) {
88
if (e) {
9+
if (e.code !== 'ENOENT') {
10+
console.log(e);
11+
}
912
return false;
1013
}
1114
}

src/components/_index.less

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
@import './start/_start';
99

1010
#crv {
11+
min-height: 600px;
1112
height: 100%;
12-
overflow: scroll;
13+
position: relative;
14+
overflow-y: scroll;
1315
}
1416

1517
#crv a, #crv a:hover, #crv a:visited {

src/components/page/_page.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
.cr-page {
22
position: relative;
3-
width: 400px;
43
&-toolbar {
54
position: fixed;
65
bottom: 0;
76
right: 0;
7+
height: 60px;
88
width: 400px;
99
&-completed {
1010
height: 200px;
1111
}
1212
}
1313
}
1414
.cr-tasks {
15+
overflow-y: scroll;
1516
.cr-task {
1617
padding: 10px;
1718
position: relative;

src/components/page/toolbar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ export default class extends React.Component<{
2626
const {callNextPage, showHint, taskPosition, tasks} = this.props;
2727
switch (true) {
2828
case taskPosition >= tasks.length:
29-
return <RaisedButton label='Continue' primary={true} onTouchTap={callNextPage}/>;
29+
return <RaisedButton label='Continue' primary={true} onTouchTap={callNextPage} />;
3030
default:
31-
return <RaisedButton label='Save' secondary={true} onTouchTap={save}/>;
31+
return <RaisedButton label='Save' secondary={true} onTouchTap={save} />;
3232
}
3333
}
3434
render() {

src/components/progress/progress.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
'use strict';
21
import * as React from 'react';
32
import {connect} from 'react-redux';
43
import * as Action from '../../actions/actions';
@@ -31,7 +30,10 @@ class ProgressPage extends React.Component<{page: CR.Page, itemPosition: CR.Posi
3130
}
3231
}
3332
canActivate(isActive, itemPosition, position) {
34-
if (isActive && itemPosition.chapter <= position.chapter && itemPosition.page <= position.page) {
33+
const earlierChapter = itemPosition.chapter < position.chapter;
34+
const currentChapter = itemPosition.chapter = position.chapter;
35+
const earlierOrCurrentPage = itemPosition.page <= position.page;
36+
if (isActive || earlierChapter || (currentChapter && earlierOrCurrentPage)) {
3537
return true;
3638
} else {
3739
return null;

src/services/exists.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ export function fileExists(pathToFile: string): boolean {
55
fs.accessSync(pathToFile, fs.R_OK | fs.W_OK);
66
} catch (e) {
77
if (e) {
8+
if (e.code !== 'ENOENT') {
9+
console.log(e);
10+
}
811
return false;
912
}
1013
}

0 commit comments

Comments
 (0)