Skip to content

Commit 5ebd885

Browse files
microbit-sammicrobit-carlos
authored andcommitted
Use input instead of div for script name (#95)
* Use input instead of div for script name * Add label to script name box * Shrink label on smaller screens * Restore the tabindex of script-description to help merging other PRs.
1 parent e4b0698 commit 5ebd885

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

editor.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,8 @@ <h2><i class="fa fa-unlock-alt"></i> <strong>{{ title }}</strong></h2>
228228
</div>
229229
</div>
230230
<div class="vbox action" id="script-box">
231-
<div id="script-name" class="flex1" contenteditable
232-
tabindex="10">
233-
</div>
231+
<label for="script-name">Script Name</label>
232+
<input id="script-name" class="flex1">
234233
<div id="script-description" contenteditable
235234
tabindex="11">
236235
</div>

python-main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function web_editor(config) {
150150

151151
// Sets the name associated with the code displayed in the UI.
152152
function setName(x) {
153-
$("#script-name").text(x);
153+
$("#script-name").val(x);
154154
}
155155

156156
// Gets the description associated with the code displayed in the UI.
@@ -160,7 +160,7 @@ function web_editor(config) {
160160

161161
// Gets the name associated with the code displayed in the UI.
162162
function getName() {
163-
return $("#script-name").text();
163+
return $("#script-name").val();
164164
}
165165

166166
// Get the font size of the text currently displayed in the editor.

static/css/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ a.command:hover {
359359
font-weight: bold;
360360
}
361361

362+
#script-box > label {
363+
font-size: 0.8rem;
364+
}
365+
362366
.blocklyTreeRow {
363367
padding-right: .3em !important;
364368
}

0 commit comments

Comments
 (0)