Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion notebook/static/notebook/js/codecell.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ define([
var input = $('<div></div>').addClass('input');
this.input = input;

var prompt_container = $('<div/>').addClass('prompt_container');

var run_this_cell = $('<div></div>').addClass('run_this_cell');
run_this_cell.prop('title', 'Run this cell');
run_this_cell.append('<i class="fa-step-forward fa"></i>');
Expand All @@ -170,6 +172,7 @@ define([
});

var prompt = $('<div/>').addClass('prompt input_prompt');

var inner_cell = $('<div/>').addClass('inner_cell');
this.celltoolbar = new celltoolbar.CellToolbar({
cell: this,
Expand All @@ -189,7 +192,8 @@ define([
this.code_mirror.on('keydown', $.proxy(this.handle_keyevent,this));
$(this.code_mirror.getInputField()).attr("spellcheck", "false");
inner_cell.append(input_area);
input.append(run_this_cell).append(prompt).append(inner_cell);
prompt_container.append(prompt).append(run_this_cell);
input.append(prompt_container).append(inner_cell);

var output = $('<div></div>');
cell.append(input).append(output);
Expand Down
26 changes: 15 additions & 11 deletions notebook/static/notebook/less/codecell.less
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,38 @@ div.input {
}
}

div.prompt_container {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: flex-start;
text-align: right;
}

/* input_area and input_prompt must match in top border and margin for alignment */
div.input_prompt {
color: @input_prompt_color;
border-top: 1px solid transparent;
}

.run_this_cell {
visibility: hidden;
div.run_this_cell {
display: none;
cursor: pointer;
color: #333;
padding-top: 5px;
padding-bottom: 5px;
padding-left: 1ex;
padding-right: 1ex;
padding-left: 2ex;
padding-right: 2ex;
width: 1ex;
}

div.code_cell div.input_prompt {
min-width: 11ex;
}

div.code_cell:hover div.input .run_this_cell {
visibility: visible;
min-width: 15ex;
}

@media (-moz-touch-enabled: 1), (any-pointer: coarse) {
.run_this_cell {
visibility: visible;
div.run_this_cell {
display: block;
}
}

Expand Down