mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
minor refactors for recent/up-coming deprecations
This commit is contained in:
parent
ffec98a6d7
commit
6bc5fe14a2
3 changed files with 11 additions and 8 deletions
|
@ -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';
|
||||
|
@ -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() {
|
||||
|
|
|
@ -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);
|
||||
},
|
||||
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
@ -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() {
|
||||
|
|
Loading…
Add table
Reference in a new issue