diff --git a/notebook/static/notebook/js/actions.js b/notebook/static/notebook/js/actions.js index 9fa550e39..2d08c12f0 100644 --- a/notebook/static/notebook/js/actions.js +++ b/notebook/static/notebook/js/actions.js @@ -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; } }, }; diff --git a/notebook/static/notebook/js/cell.js b/notebook/static/notebook/js/cell.js index bf38dd673..558039ad9 100644 --- a/notebook/static/notebook/js/cell.js +++ b/notebook/static/notebook/js/cell.js @@ -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 {