Skip to content

Commit

Permalink
Merge branch 'master' of github.com:bnmnetp/runestone
Browse files Browse the repository at this point in the history
  • Loading branch information
bnmnetp committed Jun 24, 2014
2 parents 5203e77 + 8ef3851 commit aa626ce
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
17 changes: 14 additions & 3 deletions common/js/bookfuncs.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ function createEditors() {
first_line = 1;
}
cm_editors[newEdId] = CodeMirror.fromTextArea(edList[i], {
mode: {name: lang,
version: 2,
singleLineStringErrors: false},
mode: { name: lang,
version: 2,
singleLineStringErrors: false
},
lineNumbers: true,
firstLineNumber: first_line,
indentUnit: 4,
Expand All @@ -104,10 +105,20 @@ function createEditors() {
onKeyEvent: handleEdKeys
}
);

cm_editors[newEdId].parentDiv = edList[i].parentNode.parentNode.id;
//requestCode(edList[i].parentNode.id) // populate with user's code
}

// allow ActiveCode editors to be dynamically resized by user
$('.CodeMirror').each(function (_, cmNode) {
$(cmNode).resizable({
resize: function() {
cmNode.CodeMirror.setSize($(this).width(), $(this).height());
cmNode.CodeMirror.refresh();
}
});
});
}

function builtinRead(x) {
Expand Down
8 changes: 8 additions & 0 deletions static/runestone-custom-sphinx-bootstrap.css
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ div.section {
clear:both;
}

.CodeMirror-scroll {
/* this allows CM elements to be resized to (almost) any
* height while still relying on max-height (which keeps
* the CM editors to no more than the size needed
* unless resized) */
max-height: 9999;
}

button.btn, btn.btn-sm,
input[type="submit"].btn.btn-sm,
input[type="button"].btn.btn-sm {
Expand Down

0 comments on commit aa626ce

Please sign in to comment.