Skip to content

Commit

Permalink
Merge pull request #165 from DigiKlausur/fix_annotation_ui
Browse files Browse the repository at this point in the history
When a cell is not present in the notebook, do not try to render an AnnotationUI
  • Loading branch information
tmetzl authored Sep 15, 2023
2 parents 422fe65 + fa9c403 commit 62cf01d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ let Comments = Backbone.Collection.extend({

let AnnotationUI = Backbone.View.extend({
initialize: function () {
if (this.$el.length == 0) {
console.log(
"Failed to create AnnotationUI. Cell is not present in the notebook"
);
return;
}
this.$switch = this.$el.find('input[name="annotate"]');
this.$switch.prop("checked", "checked");

Expand Down

0 comments on commit 62cf01d

Please sign in to comment.