Skip to content

Commit 175d139

Browse files
Toasts submodule refactor
1 parent 58ad399 commit 175d139

File tree

8 files changed

+13
-24
lines changed

8 files changed

+13
-24
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "source/client/js/AutoGrid"]
22
path = source/client/js/AutoGrid
33
url = [email protected]:ZitRos/AutoGrid.git
4+
[submodule "source/client/js/Toast"]
5+
path = source/client/js/Toast
6+
url = https://github.com/ZitRos/Toast.git

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "cache-visual-editor",
33
"printableName": "Cache Visual Editor",
44
"packageName": "VisualEditor",
5-
"version": "0.9.7",
5+
"version": "0.9.8",
66
"description": "Visual class editor for InterSystems Caché",
77
"main": "index.js",
88
"keywords": [

source/client/js/Toast

Submodule Toast added at acf93a6

source/client/js/classEditor/class/code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export function getCodeCaptionView ({ memberManifest, codePropertyName, data, sa
8484
ROUTINE_SUPPORT = true;
8585
} else if (hasRoutineCode(value)) {
8686
useRoutinesToggle.checkbox.checked = true;
87-
new Toast(Toast.TYPE_ERROR, `Code must not have routine definitions`);
87+
new Toast(`Code must not have routine definitions`, Toast.TYPE_ERROR);
8888
return;
8989
} else {
9090
editor.setValue(switchToNoRoutineCode(value), curPos);

source/client/js/classEditor/class/member.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ function enableMember ({
172172
del.addEventListener(`click`, () => {
173173
let delta = (-lastTimeDelClicked + (lastTimeDelClicked = (new Date()).getTime()));
174174
if (delta > 5000) { // > 5 sec - show message "click again to delete"
175-
new Toast(Toast.TYPE_INFO, `Click again to delete`);
175+
new Toast(`Click again to delete`, Toast.TYPE_INFO);
176176
} else { // delete
177177
addChange(savePath.concat(`$delete`), true);
178178
detach(headerElement);

source/client/js/classEditor/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@ function saveButtonTrigger () {
161161

162162
if (!res["error"]) {
163163
changeIsMade(false);
164-
new Toast(Toast.TYPE_DONE, `Saved!`);
164+
new Toast(`Saved!`, Toast.TYPE_DONE);
165165
} else {
166-
new Toast(Toast.TYPE_ERROR, res["error"], Toast.TIME_LONG);
166+
new Toast(res["error"], Toast.TYPE_ERROR, Toast.TIME_LONG);
167167
}
168168

169169
// // REPLACES CLASS ON SAVE (temporary commented as side effects appear)

source/client/scss/index.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
@import "domUtils";
77
@import "icons";
8-
@import "toast/toast";
8+
@import "../js/Toast/default.scss";
9+
@import "toast";
910
@import "basic";
1011
@import "autoGrid/cards";
1112
@import "classEditor/card";

source/client/scss/toast/toast.scss renamed to source/client/scss/toast.scss

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
1-
@import "../mixins";
2-
@import "../const";
1+
@import "mixins";
2+
@import "const";
33

44
$messagesAlpha: .8;
55

66
.toast {
77

8-
position: fixed;
9-
right: 0;
10-
bottom: 0;
11-
z-index: 10000;
12-
@include transition(all .3s ease);
13-
148
> .body {
159

1610
font-size: $fontNormal;
17-
margin: 1em;
18-
padding: .5em;
1911
border-radius: $defaultPadding/2;
20-
background: rgba(255, 255, 255, 0.8);
21-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
2212

2313
&.info {
2414
background: rgba($colorP1, $messagesAlpha);
@@ -28,15 +18,9 @@ $messagesAlpha: .8;
2818

2919
background: rgba($colorP4, $messagesAlpha);
3020

31-
> .icon {
32-
color: white;
33-
}
34-
3521
}
3622

3723
&.error {
38-
color: white;
39-
text-shadow: 0 0 1px black;
4024
background: rgba($colorP2, $messagesAlpha);
4125
}
4226

0 commit comments

Comments
 (0)