Skip to content

Commit 01b72dc

Browse files
authored
Fixed number of accessibility issues. Fixed bug with creating a new page. (#145)
1 parent 659f41b commit 01b72dc

File tree

14 files changed

+277
-298
lines changed

14 files changed

+277
-298
lines changed

package-lock.json

Lines changed: 34 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@
6161
"webpack-merge": "^4.2.1"
6262
},
6363
"dependencies": {
64-
"@paperbits/azure": "0.1.145",
65-
"@paperbits/common": "0.1.145",
66-
"@paperbits/core": "0.1.145",
67-
"@paperbits/prosemirror": "0.1.145",
68-
"@paperbits/styles": "0.1.145",
64+
"@paperbits/azure": "0.1.146",
65+
"@paperbits/common": "0.1.146",
66+
"@paperbits/core": "0.1.146",
67+
"@paperbits/prosemirror": "0.1.146",
68+
"@paperbits/styles": "0.1.146",
6969
"@webcomponents/webcomponentsjs": "^2.2.10",
7070
"core-js": "^3.1.4",
7171
"domino": "^2.1.3",

src/routing/unsavedChangesRouteGuard.ts

Lines changed: 35 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,42 @@ export class UnsavedChangesRouteGuard implements RouteGuard {
1313

1414
public canActivate(route: Route): Promise<boolean> {
1515
return new Promise<boolean>(async (resolve) => {
16-
if (this.offlineObjectStorage.hasUnsavedChanges()) {
17-
const path = route.path;
18-
19-
if (route.previous && route.previous.path === path) {
20-
const page = await this.pageService.getPageByPermalink(path);
21-
22-
if (page && this.offlineObjectStorage.hasUnsavedChangesAt(page.contentKey)) {
23-
const toast = this.viewManager.addToast("Unsaved changes", `You have unsaved changes. Do you want to save or discard them?`, [
24-
{
25-
title: "Save",
26-
iconClass: "paperbits-check-2",
27-
action: async (): Promise<void> => {
28-
this.offlineObjectStorage.saveChanges();
29-
this.viewManager.removeToast(toast);
30-
resolve(true);
31-
}
32-
},
33-
{
34-
title: "Discard",
35-
iconClass: "paperbits-simple-remove",
36-
action: async (): Promise<void> => {
37-
this.offlineObjectStorage.discardChanges();
38-
this.viewManager.removeToast(toast);
39-
resolve(true);
40-
}
16+
if (!this.offlineObjectStorage.hasUnsavedChanges()) {
17+
resolve(true);
18+
}
19+
20+
const path = route.path;
21+
22+
const pathNotChanged = route.previous && route.previous.path === path;
23+
24+
if (pathNotChanged) {
25+
const page = await this.pageService.getPageByPermalink(path);
26+
27+
if (!page || !page.contentKey) {
28+
resolve(true);
29+
}
30+
31+
if (this.offlineObjectStorage.hasUnsavedChangesAt(page.contentKey)) {
32+
const toast = this.viewManager.addToast("Unsaved changes", `You have unsaved changes. Do you want to save or discard them?`, [
33+
{
34+
title: "Save",
35+
iconClass: "paperbits-check-2",
36+
action: async (): Promise<void> => {
37+
await this.offlineObjectStorage.saveChanges();
38+
this.viewManager.removeToast(toast);
39+
resolve(true);
40+
}
41+
},
42+
{
43+
title: "Discard",
44+
iconClass: "paperbits-simple-remove",
45+
action: async (): Promise<void> => {
46+
await this.offlineObjectStorage.discardChanges();
47+
this.viewManager.removeToast(toast);
48+
resolve(true);
4149
}
42-
]);
43-
}
44-
else {
45-
resolve(true);
46-
}
50+
}
51+
]);
4752
}
4853
}
4954
else {

src/themes/designer/styles/balloons.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ $tip-width: 10px;
1010
z-index: $z-index-balloon;
1111
box-shadow: 0 0 2px 2px rgba(0, 0, 0, .15);
1212
border-radius: $toolbox-border-radius;
13-
line-height: $surface-lineheight;
1413
display: block;
1514

1615
&:after {

src/themes/designer/styles/draggables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
.placeholder {
2626
border: 2px dashed #ccc;
27-
border: 2px dashed darken($surface-background, 20%);
27+
border: 2px dashed darken($toolbox-background, 20%);
2828
transition: height .5s ease-in-out;
2929
position: relative;
3030
}

src/themes/designer/styles/editors/colorSelector.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
display: block;
1010
position: relative;
1111
text-align: center;
12+
line-height: 30px;
1213
}
1314

1415
.palette {

0 commit comments

Comments
 (0)