Skip to content

Commit 74fc742

Browse files
author
pseudocode88
committed
Add notification to set trading account
1 parent 273fb12 commit 74fc742

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed

index.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ main {
9898
padding: 32px;
9999
margin: auto;
100100
box-sizing: border-box;
101+
position: relative;
101102
}
102103

103104
section {
@@ -461,4 +462,20 @@ button {
461462
font-size: 10px;
462463
font-weight: 500;
463464
color: var(--content-muted);
465+
}
466+
467+
.Welcome {
468+
background-color: var(--int-support-info-primary-default);
469+
display: none;
470+
}
471+
472+
.Welcome p {
473+
font-size: 16px;
474+
font-weight: 600;
475+
line-height: 1.45;
476+
color: var(--content-secondary);
477+
}
478+
479+
.Welcome span {
480+
color: var(--content-warning)
464481
}

index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
<main class="fc f-wrap-32">
1515
<img src="assets/logo-1000.png" class="Logo" />
1616

17+
<section id="welcome-flag" class="Section Welcome">
18+
<p>Setup your trading account parameters to use the position size builder. Scroll to the bottom
19+
to see the account settings.</p>
20+
</section>
21+
1722
<section class="Section">
1823
<div class="fc f-wrap-24">
1924
<div class="fc f-wrap-12">

scripts/account-settings.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,14 @@ var AccountSettings = ($, db) => {
7070
}
7171

7272
var updateDB = () => {
73+
var that = this;
7374
db.findOne({ exchange: 'default' }, (err, docs) => {
7475
if (!docs) {
75-
db.insert(data)
76+
db.insert(data);
77+
that.observer.fire('AccountSettingsLoaded');
7678
} else {
7779
db.update({ exchange: 'default' }, data);
80+
that.observer.fire('AccountSettingsLoaded');
7881
}
7982
})
8083
}
@@ -118,6 +121,8 @@ var AccountSettings = ($, db) => {
118121
if (docs) {
119122
updateLocalData(docs);
120123
that.observer.fire('AccountSettingsLoaded');
124+
} else {
125+
that.observer.fire('AccountSettingsNotFound');
121126
}
122127
render();
123128
})

scripts/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,10 @@ $(window).on('load', () => {
2020

2121
this.observer.on('PositionSizeCalculated', this.modules.PositionSizeSuggestion.render);
2222
this.observer.on('AccountSettingsLoaded', this.modules.PositionSizeBuilder.sync);
23+
this.observer.on('AccountSettingsNotFound', () => {
24+
$('#welcome-flag').show();
25+
});
26+
this.observer.on('AccountSettingsLoaded', () => {
27+
$('#welcome-flag').hide();
28+
});
2329
})

0 commit comments

Comments
 (0)