Skip to content

Commit 630c0c2

Browse files
pkulkarkfarhaanbukhsh
authored andcommitted
fix: update styling
1 parent b306de2 commit 630c0c2

File tree

3 files changed

+36
-12
lines changed

3 files changed

+36
-12
lines changed

branching_xblock/static/css/branching_xblock.css

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,24 +187,43 @@
187187
text-decoration: none;
188188
}
189189

190+
.branching-scenario .action-row {
191+
display: flex;
192+
align-items: center;
193+
justify-content: space-between;
194+
width: 100%;
195+
}
196+
190197
.undo-button {
191-
border: none;
198+
border: 1px solid #4a5568;
192199
border-radius: 4px;
193200
padding: 0.6em 1.2em;
194201
font-size: 1em;
195202
cursor: pointer;
196-
background-image: none !important;
197-
margin-left: 1em;
203+
background: transparent;
204+
color: #1f2a37;
198205
}
199206

200207
.reset-button {
201-
border: 1px solid #4a5568;
208+
border: 1px solid #c2410c;
202209
border-radius: 4px;
203210
padding: 0.6em 1.2em;
204211
font-size: 1em;
205212
cursor: pointer;
206213
background: transparent;
207-
color: #1f2a37;
214+
color: #c2410c;
215+
}
216+
217+
.reset-button:hover,
218+
.reset-button:focus {
219+
background: #fff7ed;
220+
border-color: #9a3412;
221+
color: #9a3412;
222+
}
223+
224+
.reset-button:focus-visible {
225+
outline: 2px solid #ea580c;
226+
outline-offset: 2px;
208227
}
209228

210229
.score-display {

branching_xblock/static/html/branching_xblock.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313
</div>
1414
<div class="choices" data-role="choices"></div>
1515

16-
<button class="undo-button action-secondary btn-secondary" data-role="undo" style="display: none;">
17-
Go Back
18-
</button>
19-
<button type="button" class="reset-button action-secondary btn-secondary" data-role="reset-activity" style="display: none;">
20-
Reset
21-
</button>
16+
<div class="action-row">
17+
<button class="undo-button action-secondary btn-secondary" data-role="undo" style="display: none;">
18+
Go Back
19+
</button>
20+
<button type="button" class="reset-button action-secondary btn-secondary" data-role="reset-activity" style="display: none;">
21+
Reset
22+
</button>
23+
</div>
2224

2325
<div class="score-display" data-role="score" style="display: none;"></div>
2426
</div>

branching_xblock/static/js/src/branching_xblock.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ function BranchingXBlock(runtime, element) {
160160
const canUndo = state.enable_undo && state.history.length > 0;
161161
$el.find('.undo-button').toggle(canUndo);
162162

163-
const showReset = Boolean(state.enable_reset_activity);
163+
const isAtStartNode = Boolean(
164+
state.current_node && state.current_node.id === state.start_node_id
165+
);
166+
const showReset = Boolean(state.enable_reset_activity && !isAtStartNode);
164167
$el.find('[data-role="reset-activity"]').toggle(showReset);
165168

166169
const $score = $el.find('[data-role="score"]');

0 commit comments

Comments
 (0)