Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
Open
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
19 changes: 11 additions & 8 deletions runestone/activecode/js/activecode.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,18 @@ ActiveCode.prototype.createEditor = function (index) {
});
*/

// give the user a visual cue that they have changed but not saved
editor.on('change', (function () {
if (editor.acEditEvent == false || editor.acEditEvent === undefined) {
$(editor.getWrapperElement()).css('border-top', '2px solid #b43232');
$(editor.getWrapperElement()).css('border-bottom', '2px solid #b43232');
this.logBookEvent({'event': 'activecode', 'act': 'edit', 'div_id': this.divid});
if (this.useRunestoneServices) {
// give the user a visual cue that they have changed but not saved
// but only if it's *possible* to save
editor.on('change', (function () {
if (useRunestoneServiceseditor.acEditEvent == false || editor.acEditEvent === undefined) {
$(editor.getWrapperElement()).css('border-top', '2px solid #b43232');
$(editor.getWrapperElement()).css('border-bottom', '2px solid #b43232');
this.logBookEvent({'event': 'activecode', 'act': 'edit', 'div_id': this.divid});
}
editor.acEditEvent = true;
}).bind(this)); // use bind to preserve *this* inside the on handler.
}
editor.acEditEvent = true;
}).bind(this)); // use bind to preserve *this* inside the on handler.

this.editor = editor;
if (this.hidecode) {
Expand Down