Silenced a set in logupdates, and fixed moon phase thing in weather forecast

This commit is contained in:
Martin Donnelly 2020-02-01 17:48:18 +00:00
parent 15857f42ef
commit 762a0cf519
10 changed files with 16 additions and 15 deletions

View File

@ -118,7 +118,7 @@ const AgendaModel = Backbone.Model.extend({
const time = new Date().getTime() ;
this.set('time', time);
this.set('time', time, {silent: true});
}
});

View File

@ -53,7 +53,7 @@ const ForecastModel = Backbone.Model.extend({
const log = { 'lat' : this.get('latitude'), 'long': this.get('longitude'), 'time': new Date().getTime() };
this.set('log', log);
this.set('log', log, {silent: true});
this.timerID = setTimeout(
() => this.tick(),

View File

@ -38,11 +38,12 @@ const NearbyModel = Backbone.Model.extend({
);
},
'onChange': function() {
console.log('>> Nearby:Changed: ', this);
if (this.get('atHome')) {
console.log('At home, so no fetching...');
this.logUpdate();
}
else
else
this.throttledGetNearby();
},
'getNearby': function() {
@ -94,7 +95,7 @@ const NearbyModel = Backbone.Model.extend({
const time = new Date().getTime() ;
this.set('time', time);
this.set('time', time, { 'silent': true });
}
});

View File

@ -86,7 +86,7 @@ const NearbyListModel = Backbone.Model.extend({
const time = new Date().getTime() ;
this.set('time', time);
this.set('time', time, { 'silent': true });
this.timerID = setTimeout(
() => this.tick(),

View File

@ -90,7 +90,7 @@ const NewsModel = Backbone.Model.extend({
const time = new Date().getTime() ;
this.set('time', time);
this.set('time', time, {silent: true});
this.timerID = setTimeout(
() => this.tick(),

View File

@ -86,7 +86,7 @@ const NewsListModel = Backbone.Model.extend({
const time = new Date().getTime() ;
this.set('time', time);
this.set('time', time, {silent: true});
this.timerID = setTimeout(
() => this.tick(),

View File

@ -118,7 +118,7 @@ const TrafficModel = Backbone.Model.extend({
const time = new Date().getTime() ;
this.set('time', time);
this.set('time', time, {silent: true});
}
});

View File

@ -129,7 +129,7 @@ const WeatherModel = Backbone.Model.extend({
const log = { 'lat' : this.get('latitude'), 'long': this.get('longitude'), 'time': new Date().getTime() };
this.set('log', log);
this.set('log', log, { 'silent': true });
this.timerID = setTimeout(
() => this.tick(),

View File

@ -97,7 +97,7 @@ const WeatherAlertModel = Backbone.Model.extend({
toHour(1000)
);
console.log('>>WeatherAlert log', log);
this.set('log', log);
this.set('log', log, { 'silent': true });
// console.log(this);
},
'tick': function () {
@ -171,7 +171,7 @@ const WeatherAlertView = Backbone.View.extend({
console.log('>> WeatherAlert received focus msg');
if (!this.model.has('log')) {
console.log('No log yet');
return ;
}
const now = new Date().getTime();

View File

@ -134,9 +134,7 @@ const templates = {
</div>
<h3>Sun & Moon</h3>
<div class="mui-row">
<div class="mui-col-xs-3 mui--text-left mui--text-title"><%=moonphase %></div>
</div>
<div class="mui-row">
<div class="mui-col-xs-3 mui--text-left mui--text-body2">Sunrise</div>
<div class="mui-col-xs-3 mui--text-right mui--text-title"><%=sunriseTime %></div>
@ -144,7 +142,9 @@ const templates = {
<div class="mui-col-xs-3 mui--text-right mui--text-title"><%=sunsetTime %></div>
</div>
<div class="mui-row">
<div class="mui-col-xs-12 mui--text-right mui--text-title"><%=moonphase %></div>
</div>
</div>
`),
'templateDirections': _.template(`