Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
minor refactors for recent/up-coming deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinansfield committed Mar 28, 2017
1 parent 6ca2334 commit eb36bb4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
5 changes: 2 additions & 3 deletions app/components/gh-fullscreen-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import RSVP from 'rsvp';
import injectService from 'ember-service/inject';
import {A as emberA} from 'ember-array/utils';
import {isBlank} from 'ember-utils';
import on from 'ember-evented/on';
import run from 'ember-runloop';
import {invokeAction} from 'ember-invoke-action';
import computed from 'ember-computed';
Expand Down Expand Up @@ -34,11 +33,11 @@ const FullScreenModalComponent = Component.extend({
return modalClasses.join(' ');
}),

closeDropdowns: on('didInsertElement', function () {
didInsertElement() {
run.schedule('afterRender', this, function () {
this.get('dropdown').closeDropdowns();
});
}),
},

actions: {
close() {
Expand Down
4 changes: 2 additions & 2 deletions app/components/gh-profile-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ export default Component.extend({
}
},

didReceiveAttrs(attrs) {
didReceiveAttrs() {
this._super(...arguments);
let timeout = parseInt(attrs.newAttrs.throttle || this.get('debounce'));
let timeout = parseInt(this.get('throttle') || this.get('debounce'));
run.debounce(this, 'trySetValidEmail', timeout);
},

Expand Down
10 changes: 7 additions & 3 deletions app/components/gh-tag-settings-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import Component from 'ember-component';
import Ember from 'ember';
import computed, {reads} from 'ember-computed';
import get from 'ember-metal/get';
import injectService from 'ember-service/inject';
import {htmlSafe} from 'ember-string';

Expand Down Expand Up @@ -86,12 +85,17 @@ export default Component.extend({
return metaDescription;
}),

didReceiveAttrs(attrs) {
didReceiveAttrs() {
this._super(...arguments);

if (get(attrs, 'newAttrs.tag.value.id') !== get(attrs, 'oldAttrs.tag.value.id')) {
let oldTagId = this._oldTagId;
let newTagId = this.get('tag.id');

if (newTagId !== oldTagId) {
this.reset();
}

this._oldTagId = newTagId;
},

reset() {
Expand Down

0 comments on commit eb36bb4

Please sign in to comment.