Skip to content

Commit

Permalink
Fixed preview selectors. Fixes DrewML#10
Browse files Browse the repository at this point in the history
  • Loading branch information
333fred committed Jan 21, 2017
1 parent 9a89069 commit 966fd71
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/js/dom.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
const qs = document.querySelector.bind(document);

export function getAuthenticityToken() {
return qs('input[name="authenticity_token"]').value;
return qs('.timeline-comment > .js-previewable-comment-form')
.getAttribute('data-preview-authenticity-token');
}

export function getComment(form) {
return form.querySelector('.js-comment-field').value;
}

export function getPreviewUri() {
return qs('.js-previewable-comment-form')
return qs('.timeline-comment > .js-previewable-comment-form')
.getAttribute('data-preview-url');
}

Expand Down

0 comments on commit 966fd71

Please sign in to comment.