Fix some small bugs

Jonathan Frederic 10 years ago
parent 75a3052c07
commit c14302e547

@ -413,7 +413,8 @@ define(function(require){
help: 'toggle marks',
icon: 'fa-check',
handler : function(env){
env.notebook.get_selected_cell.marked ^= true;
// Use bitwise logic to toggle the marked state.
env.notebook.get_selected_cell().marked ^= true;
}
},
};

@ -293,7 +293,10 @@ define([
},
set: function(value) {
var isMarked = this.element.hasClass('marked');
if (isMarked !== value) {
// Use a casting comparison. Allows for the caller to assign 0 or
// 1 instead of a boolean value, which in return means the caller
// can do cell.marked ^= true to toggle the mark.
if (isMarked != value) {
if (value) {
this.element.addClass('marked');
} else {

Loading…
Cancel
Save