Skip to content

Commit

Permalink
Merge pull request #186 from srsgores/master
Browse files Browse the repository at this point in the history
refactor: refactor jQuery usages to element selectors
  • Loading branch information
lukemelia authored Nov 18, 2020
2 parents 17eb948 + 95a2f7b commit 9eea2a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion addon/components/mobiledoc-editor/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export default Component.extend({
didRender() {
let editor = this.get('editor');
if (!editor.hasRendered) {
let editorElement = this.$('.mobiledoc-editor__editor')[0];
let editorElement = this.element.querySelector('.mobiledoc-editor__editor');
this._isRenderingEditor = true;
try {
editor.render(editorElement);
Expand Down
2 changes: 1 addition & 1 deletion addon/components/mobiledoc-link-prompt/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ export default Component.extend({
layout,

didInsertElement() {
this.$('input').focus();
this.element.querySelector('input').focus();
}
});
14 changes: 7 additions & 7 deletions addon/components/tether-to-selection/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ export default Component.extend({
let isOffscreen = isOutOfBounds(dialogRect, boundingRect);
if (isOffscreen) {
let dialogAnchor = this.get('dialogAnchor');
this.$().css({
position: 'fixed',
left: isOffscreen.left ? DIALOG_MARGIN : (isOffscreen.right ? 'auto' : dialogAnchor.left),
right: isOffscreen.right ? DIALOG_MARGIN : 'auto',
top: isOffscreen.top ? DIALOG_MARGIN : 'auto',
bottom: isOffscreen.bottom ? DIALOG_MARGIN : (isOffscreen.top ? 'auto' : dialogAnchor.bottom)
});
this.element.setAttribute('style', `
position: 'fixed';
left: ${isOffscreen.left ? DIALOG_MARGIN : (isOffscreen.right ? 'auto' : dialogAnchor.left)};
right: ${isOffscreen.right ? DIALOG_MARGIN : 'auto'};
top: ${isOffscreen.top ? DIALOG_MARGIN : 'auto'};
bottom: ${isOffscreen.bottom ? DIALOG_MARGIN : (isOffscreen.top ? 'auto' : dialogAnchor.bottom)};
`);
}
});
}
Expand Down

0 comments on commit 9eea2a5

Please sign in to comment.