Permalink
Browse files

Merge pull request #72 from jsyeo/eval_button

use input buttons for evaluate buttons
  • Loading branch information...
2 parents 94947d0 + b64d893 commit c89394b085639ef26a5dac83e0d69d14926bfbe7 @kini kini committed Jun 20, 2012
Showing with 9 additions and 5 deletions.
  1. +3 −4 sagenb/data/sage/html/notebook/cell.html
  2. +5 −0 sagenb/data/sage/js/notebook_lib.js
  3. +1 −1 sass/src/main.scss
@@ -68,12 +68,11 @@
<textarea class="{{ input_cls }}" rows="{{ (1, cell.input_text().strip()|number_of_rows(80))|max }}"
cols="80"
id="cell_input_{{ cell.id() }}">{{ cell.input_text().rstrip() }}</textarea>
- <a href="javascript:evaluate_cell({{ '%r'|format(cell.id()) }}, 0);"
+ <input type="button"
class="eval_button"
id="eval_button{{ cell.id() }}"
- title="{{ gettext('Click here or press shift-return to evaluate') }}">
- {{ gettext('evaluate') }}
- </a>
+ title="{{ gettext('Click here or press shift-return to evaluate') }}"
+ value="{{ gettext('evaluate') }}" />
{% endif %}
{# end input #}
@@ -379,6 +379,11 @@ function bind_events() {
var cell_id = get_cell_id_from_id(id);
return input_keypress(cell_id, event);
});
+ $('.eval_button').click(function () {
+ var id = $(this).attr("id");
+ var cell_id = get_cell_id_from_id(id);
+ evaluate_cell(cell_id, 0);
+ }
}
View
@@ -862,7 +862,7 @@ div {
textarea.cell_input:hover {
cursor: text; }
-a {
+input {
&.eval_button {
display: none; }
&.eval_button_active {

0 comments on commit c89394b

Please sign in to comment.