Skip to content

Commit 9db57ea

Browse files
committed
codemirror height auto
1 parent b29405e commit 9db57ea

2 files changed

Lines changed: 40 additions & 38 deletions

File tree

src/components/training/training.html

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,37 +17,17 @@
1717
<div class='font14-lit-gray select-dropdown-text' ng-repeat="language in languages">
1818
{{language}}
1919
</div>
20-
<!--<select class="language-select-dropdown " ng-init="selectedLanguage = languages[0]" ng-model="selectedLanguage"
21-
ng-options="x for x in languages">
22-
</select>-->
2320
</div>
2421
<div class='select-dropdown'>
2522
<div class='font14-lit-gray select-dropdown-text'>
2623
{{versions}}
2724
</div>
28-
<!--<select class="language-version-select-dropdown" ng-init="selectedVersion = versions[0]" ng-model="selectedVersion" ng-options="x for x in versions">
29-
</select>-->
3025
</div>
3126
<div class="assorted-options">
3227
</div>
3328
</div>
3429
</div>
3530
<div class="kata">
36-
<!-- <div class="instructions">
37-
<div class="instructions-head">
38-
<button class="instructions-selector font13-reg-gray">Instructions</button>
39-
<button class="instructions-selector font13-reg-gray">Output</button>
40-
</div>
41-
<hr>
42-
<h2 class="font20-reg">Name of Kata</h2>
43-
<div>
44-
<p>Here's where the instructions go. We have to think about how to present code samples.</p>
45-
<div ng-repeat="test in output">
46-
<p>{{test.test}}</p>
47-
<p>{{test.result}}</p>
48-
</div>
49-
</div>
50-
</div> -->
5131
<div class="instructions" ng-style="instructionStyle">
5232
<div class="instructions-head">
5333
<div class='instructions-selector font14-lit-gray' ng-click='showInstructions()'>
@@ -56,14 +36,12 @@ <h2 class="font20-reg">Name of Kata</h2>
5636
<div class='output-selector font14-lit-gray' ng-click='showOutput()'>
5737
<div class='button-text'>Output</div>
5838
</div>
59-
<!--<button class="instructions-selector font13-reg-gray" ng-click="showInstructions()">Instructions</button>
60-
<button class="instructions-selector font13-reg-gray" ng-click="showOutput()">Output</button>-->
6139
</div>
62-
<!--<hr>-->
6340
<show-output ng-hide="showOutputShow"></show-output>
6441
<show-instructions ng-hide="showInstructionsShow"></show-instructions>
6542
</div>
6643
<div class="kata-right" ng-style='kataStyle'>
44+
<!--*****************SOLUTIONS DIV*********************-->
6745
<div class="solution-div font14-lit-gray">
6846
<div class="solutions-header">
6947
<p>Solution:</p>
@@ -72,16 +50,14 @@ <h2 class="font20-reg">Name of Kata</h2>
7250
<button value='large' ng-click="kataStyle={'width':'100vw','margin':'15px'}; instructionStyle={'display':'none'}; allGone={'height':'100px'}">large</button>
7351
<button value='full-screen' ng-click="kataStyle={'width':'100vw','margin':'15px'}; instructionStyle={'display':'none'}; allGone={'display':'none'}; exampleGone={'display':'none'}">full screen</button>-->
7452
</div>
75-
<div ng-style="exampleGone" class='example'>
76-
<textarea name="solution" id="solution-input" ng-init="solutionInput = 'var a = 1;'" ng-model="solutionInput"></textarea>
77-
</div>
53+
<textarea ng-style="exampleGone" name="solution" id="solution-input" ng-model="solutionInput"
54+
class='CodeMirror solution'></textarea>
7855
</div>
56+
<!--*****************EXAMPLES DIV*********************-->
7957
<div class="example-tests-div font14-lit-gray">
8058
<p>Example Tests:</p>
81-
<div>
82-
<textarea name="examples" id="example-input" ng-init="examplesInput = 'Test.assertEquals(a, 1);'" id="example-tests-input"
83-
ng-model="examplesInput"></textarea>
84-
</div>
59+
<textarea name="examples" id="example-input" ng-init="examplesInput = 'Test.assertEquals(a, 1);'" id="example-tests-input"
60+
ng-model="examplesInput" class='CodeMirror'></textarea>
8561
<div class='button-div'>
8662
<button ng-click="testExamples()" class="test-examples-button font12-reg-blue">RUN EXAMPLES</button>
8763
<button ng-click="testSuite()" class="test-suite-button font12-reg-black"><i class="fa fa-caret-right fa-lg" style="margin-right: 2px" aria-hidden="true"></i>ATTEMPT</button>

src/components/training/training.scss

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,31 +89,56 @@ $white: white;
8989

9090
}
9191

92-
/***********MAIN TRAINING AREA***********/
92+
/***********MAIN TRAINING AREA LEFT***********/
9393
.kata {
9494
display: flex;
9595
flex-direction: row;
9696
justify-content: space-between;
9797
}
9898

99+
.CodeMirror {
100+
border: 1px solid #eee;
101+
height: auto !important;
102+
}
103+
99104
.kata-right {
100105
display: flex;
101106
flex-direction: column;
102107
padding-top: 2vh;
103-
height: 105vh;
104-
width: 60vw;
108+
height: calc(100vh - 145px);
109+
width: calc(60vw - 30px);
105110
background-color: $container1;
106111
margin: 15px 15px 15px 0;
107112
padding: 10px;
108113
}
109114

115+
.solution-div {
116+
height: 30vh;
117+
}
118+
119+
.solutions-header {
120+
height: 40px;
121+
}
122+
123+
.solution {
124+
height: calc(30vh - 40px);
125+
}
126+
127+
.example-header {
128+
height: 40px;
129+
}
130+
131+
.example-tests-div{
132+
height:20vh;
133+
}
134+
110135
.instructions {
111-
width: 40vw;
136+
width: calc(40vw - 15px);
112137
overflow: scroll;
113138
margin: 15px;
114139
background-color: $container1;
115140
// padding: 10px;
116-
height: 105vh;
141+
height: calc(100vh - 145px);
117142
}
118143

119144
.instructions-head {
@@ -158,6 +183,9 @@ hr {
158183
background-image: -linear-gradient(left, transparent, rgba(255,255,255,0.1) 20%, rgba(255,255,255,0.1) 80%, transparent);
159184
}
160185

186+
/***********MAIN TRAINING AREA RIGHT***********/
187+
188+
161189
.test-examples-button {
162190
border: 1px solid #91b2e7;
163191
border-radius: 4%;
@@ -167,6 +195,7 @@ hr {
167195
margin:15px;
168196
}
169197

198+
170199
.test-suite-button {
171200
border: 1px solid #91b2e7;
172201
border-radius: 4%;
@@ -239,6 +268,3 @@ hr {
239268
padding: 0 0 0 30px;
240269
}
241270

242-
CodeMirror {
243-
height: auto;
244-
}

0 commit comments

Comments
 (0)