Skip to content

Commit

Permalink
Atoms should not be editable
Browse files Browse the repository at this point in the history
  • Loading branch information
rlivsey authored and mixonic committed Feb 2, 2016
1 parent 5b887b1 commit 573453a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/js/renderers/editor-dom.js
Expand Up @@ -113,6 +113,7 @@ function renderCard() {

function renderAtom(element, previousRenderNode) {
let atomElement = document.createElement('span');
atomElement.contentEditable = false;
addClassName(atomElement, '-mobiledoc-kit__atom');

if (previousRenderNode) {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/renderers/editor-dom-test.js
Expand Up @@ -210,7 +210,7 @@ test('renders a post with atom', (assert) => {
}
}
]);
assert.equal(renderTree.rootElement.innerHTML, `<p><span class="-mobiledoc-kit__atom">@bob</span></p>`);
assert.equal(renderTree.rootElement.innerHTML, `<p><span contenteditable="false" class="-mobiledoc-kit__atom">@bob</span></p>`);
});

test('renders a post with mixed markups and atoms', (assert) => {
Expand Down Expand Up @@ -238,7 +238,7 @@ test('renders a post with mixed markups and atoms', (assert) => {
}
]);

assert.equal(renderTree.rootElement.innerHTML, `<p><b>bold<i>italic <span class="-mobiledoc-kit__atom">@bob</span></i> bold</b>text.</p>`);
assert.equal(renderTree.rootElement.innerHTML, `<p><b>bold<i>italic <span contenteditable="false" class="-mobiledoc-kit__atom">@bob</span></i> bold</b>text.</p>`);
});

test('renders a card section', (assert) => {
Expand Down

0 comments on commit 573453a

Please sign in to comment.