Skip to content

Commit

Permalink
Style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike North committed Aug 24, 2015
1 parent 74d810f commit c3892bc
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions addon/services/resize.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ export default Base.extend(Evented, {
},

_updateCachedWindowSize(w, h, debounced=false) {

this.setProperties({
[`_oldWidth${debounced ? 'Debounced' : ''}`]: w,
[`_oldHeight${debounced ? 'Debounced' : ''}`]: h
});
const wKey = `_oldWidth${debounced ? 'Debounced' : ''}`;
const hKey = `_oldHeight${debounced ? 'Debounced' : ''}`;
let props = {};
props[wKey] = w;
props[hKey] = h;
this.setProperties(props);
},

_installResizeListener() {
Expand All @@ -62,14 +63,14 @@ export default Base.extend(Evented, {
},

_fireResizeNotification(evt) {
const {innerWidth, innerHeight} = window;
const { innerWidth, innerHeight } = window;
if (this._hasWindowSizeChanged(innerWidth, innerHeight)) {
this.trigger('didResize', evt);
this._updateCachedWindowSize(innerWidth, innerHeight);
}
},
_fireDebouncedResizeNotification(evt) {
const {innerWidth, innerHeight} = window;
const { innerWidth, innerHeight } = window;
if (this._hasWindowSizeChanged(innerWidth, innerHeight, true)) {
this.trigger('debouncedDidResize', evt);
this._updateCachedWindowSize(innerWidth, innerHeight, true);
Expand Down

0 comments on commit c3892bc

Please sign in to comment.