From 8980ac3925c272557acd834e42dab81926498b03 Mon Sep 17 00:00:00 2001 From: lone-cloud Date: Fri, 30 Oct 2015 00:23:14 -0700 Subject: [PATCH] bug fixes for days --- app/pods/components/hue-controls/component.js | 12 +++++------- app/pods/components/light-group/component.js | 6 ++---- app/pods/components/light-group/template.hbs | 2 +- app/pods/components/music-tab/component.js | 1 - app/styles/app.scss | 7 ++----- 5 files changed, 10 insertions(+), 18 deletions(-) diff --git a/app/pods/components/hue-controls/component.js b/app/pods/components/hue-controls/component.js index 46e1bd9..ed137c3 100644 --- a/app/pods/components/hue-controls/component.js +++ b/app/pods/components/hue-controls/component.js @@ -198,7 +198,8 @@ export default Em.Component.extend({ if(!this.get('trial')) { this.doUpdateGroupsData(); - this.set('lightsDataIntervalHandle', setInterval(this.updateLightData.bind(this), 1000)); + this.updateLightData(); + this.set('lightsDataIntervalHandle', setInterval(this.updateLightData.bind(this), 2000)); } if (!Em.isNone(this.get('storage').get('huegasm.selectedTab'))) { @@ -208,17 +209,14 @@ export default Em.Component.extend({ onUpdateGroupsDataChange: function(){ if(this.get('updateGroupsData')){ - var self = this; - setTimeout(function(){ self.doUpdateGroupsData(); }, 1000); + setTimeout(()=>{ this.doUpdateGroupsData(); }, 1000); } }.observes('updateGroupsData'), doUpdateGroupsData(){ - var self = this; - - Em.$.get(this.get('apiURL') + '/groups', function (result, status) { + Em.$.get(this.get('apiURL') + '/groups', (result, status)=>{ if (status === 'success' ) { - self.set('groupsData', result); + this.set('groupsData', result); } }); diff --git a/app/pods/components/light-group/component.js b/app/pods/components/light-group/component.js index 3a4f642..7fce746 100644 --- a/app/pods/components/light-group/component.js +++ b/app/pods/components/light-group/component.js @@ -10,7 +10,7 @@ export default Em.Component.extend({ actions: { clickLight(id, data){ - var light = Em.$(event.target); + var light = Em.$('.light'+id); if(!light.hasClass('bootstrapTooltip')){ light = light.parent(); @@ -68,7 +68,7 @@ export default Em.Component.extend({ if(!this.get('isHovering')){ var lightsData = this.get('lightsData'), lightsList = Em.A(), type; for (var key in lightsData) { - if (lightsData.hasOwnProperty(key)) { + if (lightsData.hasOwnProperty(key) && lightsData[key].state.reachable) { switch(lightsData[key].modelid){ case 'LCT001': type = 'a19'; @@ -114,8 +114,6 @@ export default Em.Component.extend({ if(!this.get('activeLights').contains(key)){ activeClass = 'lightInactive'; - } else if(!lightsData[key].state.reachable){ - activeClass = 'lightUnreachable'; } lightsList.push({type: type, name: lightsData[key].name, id: key, data: lightsData[key], activeClass: activeClass}); diff --git a/app/pods/components/light-group/template.hbs b/app/pods/components/light-group/template.hbs index d47c752..1a37454 100644 --- a/app/pods/components/light-group/template.hbs +++ b/app/pods/components/light-group/template.hbs @@ -1,5 +1,5 @@ {{#each lightsList as |light|}} -
+
{{/each}} \ No newline at end of file diff --git a/app/pods/components/music-tab/component.js b/app/pods/components/music-tab/component.js index 25d0b39..4c47055 100644 --- a/app/pods/components/music-tab/component.js +++ b/app/pods/components/music-tab/component.js @@ -66,7 +66,6 @@ export default Em.Component.extend(helperMixin, visualizerMixin, { if(resultObj instanceof Array){ resultObj.forEach(processResult); } else { - processResult(resultObj); } diff --git a/app/styles/app.scss b/app/styles/app.scss index 993b5bf..446553e 100644 --- a/app/styles/app.scss +++ b/app/styles/app.scss @@ -27,6 +27,8 @@ body { #introPic { display: block; margin: 0 auto; + width: 100%; + max-width: 600px; } .introParagraph { @@ -337,10 +339,6 @@ md-slider.md-default-theme .md-thumb:after { } } -.lightUnreachable { - display: none; -} - .lightActive { cursor: pointer; @@ -900,7 +898,6 @@ body.dimmerOn { } svg { -webkit-filter: drop-shadow(0 0 5px #228DFF); - filter: drop-shadow(0 0 5px #228DFF); } md-input-container { label {