Appending an element to the current open view?


#1

I’m trying to build a small extension, i want to add a div to the div.item-views from the current editor.
I have the default code from package generator, apart from the edit I made to the content function in personalize-view.js (my package is called personalize)

PersonalizeView.content = function() {
  div = $('</div>', {class: 'personalize'});
  console.log(atom.workspaceView.getActiveView());
  div.appendTo(atom.workspaceView.getActiveView().find('.item-views'));
  // I get an error when I don't return this
  return this.div();
};

But when I inspect my editor after toggling personalize on, there is no div appended to .item-views. Does anybody know what I’m doing wrong?