From e3c74b0e6052dafc84220f10221e330c5b54a29d Mon Sep 17 00:00:00 2001 From: lone-cloud Date: Thu, 17 Mar 2016 22:44:02 -0700 Subject: [PATCH] upgrade to the latest ember + fix bug for the power button --- app/pods/components/lights-tab/component.js | 22 +++++++++------------ bower.json | 4 ++-- package.json | 10 +++++----- testem.json => testem.js | 5 +++-- tests/helpers/module-for-acceptance.js | 4 ++-- tests/helpers/resolver.js | 2 +- tests/index.html | 18 ++++++++--------- 7 files changed, 31 insertions(+), 34 deletions(-) rename testem.json => testem.js (81%) diff --git a/app/pods/components/lights-tab/component.js b/app/pods/components/lights-tab/component.js index b1a1ebb..d8cacfa 100644 --- a/app/pods/components/lights-tab/component.js +++ b/app/pods/components/lights-tab/component.js @@ -45,8 +45,6 @@ export default Em.Component.extend({ }, didInsertElement() { - // TODO figure out how to convert this - //this.xyToRgb(0.5,0.5); Em.$(document).click((event)=>{ if(this.get('colorPickerDisplayed') && !event.target.classList.contains('color') && !Em.$(event.target).closest('.colorpicker, #colorRow').length) { this.toggleProperty('colorPickerDisplayed'); @@ -112,18 +110,18 @@ export default Em.Component.extend({ } }.observes('colorLoopOn'), + lightsOn: false, + // determines whether the lights are on/off for the lights switch - lightsOn: function(){ - var lightsData = this.get('lightsData'); + lightsOnCHange: function(){ + if(!this.get('strobeOn')){ + var lightsData = this.get('lightsData'), lightsOn = this.get('activeLights').some(function(light) { + return lightsData[light].state.on === true; + }); - if(this.get('strobeOn')){ - return false; + this.set('lightsOn', lightsOn); } - - return this.get('activeLights').some(function(light) { - return lightsData[light].state.on === true; - }); - }.property('lightsData.@each.state.on', 'activeLights.[]', 'strobeOn'), + }.observes('lightsData.@each.state.on', 'activeLights.[]'), // determines the average brightness of the hue system for the brightness slider lightsBrightness: function(){ @@ -157,8 +155,6 @@ export default Em.Component.extend({ } }.observes('lightsOn'), - - onBrightnessChanged: function(){ var lightsData = this.get('lightsData'), lightsBrightnessSystem = false, lightsBrightness = this.get('lightsBrightness'), activeLights = this.get('activeLights'), self = this; diff --git a/bower.json b/bower.json index bab6844..aa1f43b 100644 --- a/bower.json +++ b/bower.json @@ -2,9 +2,9 @@ "name": "huegasm", "dependencies": { "bootstrap-sass": "~3.3.5", - "ember": "~2.3.1", + "ember": "~2.4.1", "ember-cli-shims": "0.1.0", - "ember-cli-test-loader": "0.2.1", + "ember-cli-test-loader": "0.2.2", "ember-load-initializers": "0.5.1", "ember-qunit-notifications": "0.1.0", "hammerjs": "~2.0.4", diff --git a/package.json b/package.json index 0c05f76..ae4d006 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "devDependencies": { "broccoli-asset-rev": "^2.2.0", "ember-ajax": "0.7.1", - "ember-cli": "^2.3.0", + "ember-cli": "^2.4.2", "ember-cli-app-version": "^1.0.0", "ember-cli-babel": "^5.1.5", "ember-cli-dependency-checker": "^1.2.0", @@ -32,16 +32,16 @@ "ember-cli-qunit": "^1.2.1", "ember-cli-release": "0.2.8", "ember-cli-sass": "5.2.1", - "ember-cli-sri": "^2.0.0", + "ember-cli-sri": "^2.1.0", "ember-cli-uglify": "^1.2.0", "ember-cli-windows-addon": "^1.2.2", - "ember-data": "^2.3.0", + "ember-data": "^2.4.0", "ember-disable-proxy-controllers": "^1.0.1", "ember-export-application-global": "^1.0.4", "ember-load-initializers": "^0.5.0", "ember-modal-dialog": "0.8.3", - "ember-notify": "^4.0.1", - "ember-paper": "^0.2.11", + "ember-notify": "^5.0.2", + "ember-paper": "^0.2.12", "ember-resolver": "^2.0.3", "ember-truth-helpers": "1.2.0", "loader.js": "^4.0.0" diff --git a/testem.json b/testem.js similarity index 81% rename from testem.json rename to testem.js index 0f35392..26044b2 100644 --- a/testem.json +++ b/testem.js @@ -1,4 +1,5 @@ -{ +/*jshint node:true*/ +module.exports = { "framework": "qunit", "test_page": "tests/index.html?hidepassed", "disable_watching": true, @@ -9,4 +10,4 @@ "PhantomJS", "Chrome" ] -} +}; diff --git a/tests/helpers/module-for-acceptance.js b/tests/helpers/module-for-acceptance.js index ed23003..8c8b74e 100644 --- a/tests/helpers/module-for-acceptance.js +++ b/tests/helpers/module-for-acceptance.js @@ -13,11 +13,11 @@ export default function(name, options = {}) { }, afterEach() { - destroyApp(this.application); - if (options.afterEach) { options.afterEach.apply(this, arguments); } + + destroyApp(this.application); } }); } diff --git a/tests/helpers/resolver.js b/tests/helpers/resolver.js index ebfb4e4..b208d38 100644 --- a/tests/helpers/resolver.js +++ b/tests/helpers/resolver.js @@ -1,4 +1,4 @@ -import Resolver from 'ember/resolver'; +import Resolver from '../../resolver'; import config from '../../config/environment'; const resolver = Resolver.create(); diff --git a/tests/index.html b/tests/index.html index 7a4e8a7..0cdd486 100644 --- a/tests/index.html +++ b/tests/index.html @@ -7,28 +7,28 @@ - {{content-for 'head'}} - {{content-for 'test-head'}} + {{content-for "head"}} + {{content-for "test-head"}} - {{content-for 'head-footer'}} - {{content-for 'test-head-footer'}} + {{content-for "head-footer"}} + {{content-for "test-head-footer"}} - {{content-for 'body'}} - {{content-for 'test-body'}} + {{content-for "body"}} + {{content-for "test-body"}} + - - {{content-for 'body-footer'}} - {{content-for 'test-body-footer'}} + {{content-for "body-footer"}} + {{content-for "test-body-footer"}}