"use strict";
// Hazard
$("#hazard_btn").bind('click', function() {
- //This is temporary until AMB supports setting values from JS
- bootstrap.carIndicator.status.hazard = !bootstrap.carIndicator.status.hazard;
- hvacControler.prototype.onHazardChanged(bootstrap.carIndicator.status.hazard);
- //TODO remove once functionality exists for each button
-
bootstrap.carIndicator.setStatus("hazard", !bootstrap.carIndicator.status.hazard);
bootstrap.carIndicator.setStatus("DirectionIndicationINST", !bootstrap.carIndicator.status.hazard ? 3 : 0);
bootstrap.carIndicator.setStatus("DirectionIndicationMS", !bootstrap.carIndicator.status.hazard ? 3 : 0);
});
// AirRecirculation
$("#fan_control_circ").bind('click', function() {
- bootstrap.carIndicator.status.airRecirculation = !bootstrap.carIndicator.status.airRecirculation;
- hvacControler.prototype.onAirRecirculationChanged(bootstrap.carIndicator.status.airRecirculation);
-
bootstrap.carIndicator.setStatus("airRecirculation", !bootstrap.carIndicator.status.airRecirculation);
bootstrap.carIndicator.setStatus("RecircReq", !bootstrap.carIndicator.status.airRecirculation ? 1 : 0);
});
}
bootstrap.carIndicator.setStatus("seatHeaterRight", status);
- if (status === 0) {
- bootstrap.carIndicator.setStatus("HeatedSeatFRModeRequest", 3);
- } else {
- bootstrap.carIndicator.setStatus("HeatedSeatFRModeRequest", 0);
- }
-
- var request;
-
- switch (status) {
- case 0:
- case 1:
- request = status;
- break;
- case 2:
- request = 3;
- break;
- case 3:
- request = 5;
- break;
- }
-
- bootstrap.carIndicator.setStatus("HeatedSeatFRRequest", request);
+ bootstrap.carIndicator.setStatus("HeatedSeatFRRequest", status);
}
});
// SeatHeater - front left
break;
}
bootstrap.carIndicator.setStatus("seatHeaterLeft", status);
-
- if (status === 0) {
- bootstrap.carIndicator.setStatus("HeatedSeatFLModeRequest", 3);
- } else {
- bootstrap.carIndicator.setStatus("HeatedSeatFLModeRequest", 0);
- }
-
- var request;
-
- switch (status) {
- case 0:
- case 1:
- request = status;
- break;
- case 2:
- request = 3;
- break;
- case 3:
- request = 5;
- break;
- }
-
- bootstrap.carIndicator.setStatus("HeatedSeatFLRequest", request);
+ bootstrap.carIndicator.setStatus("HeatedSeatFLRequest", status);
}
});
// AirflowDirection - FloorDuct - 1 (FOOT)
$("#fan_dir_down_btn").bind('click', function() {
var currentStatus = bootstrap.carIndicator.status.airflowDirection;
//TODO removed temp until set is enabled
- if ((currentStatus >= 0) && (currentStatus <= 7)){ // && (bootstrap.carIndicator.status.fanSpeed !== 0)) {
+ if ((currentStatus >= 0) && (currentStatus <= 7) && (bootstrap.carIndicator.status.fanSpeed !== 0)) {
var newStatus = changeAirflowDirectionStatus("#fan_dir_down_btn", currentStatus, 1);
hvacControler.prototype.onAirflowDirectionChanged(1);
setAirFlowDirectionStatus(newStatus);
// AirflowDirection - Defroster - 4 (SCREEN)
$("#fan_dir_up_btn").bind('click', function() {
var currentStatus = bootstrap.carIndicator.status.airflowDirection;
- if ((currentStatus >= 0) && (currentStatus <= 7)){ // && (bootstrap.carIndicator.status.fanSpeed !== 0)) {
+ if ((currentStatus >= 0) && (currentStatus <= 7) && (bootstrap.carIndicator.status.fanSpeed !== 0)) {
var newStatus = changeAirflowDirectionStatus("#fan_dir_up_btn", currentStatus, 4);
hvacControler.prototype.onAirflowDirectionChanged(4);
setAirFlowDirectionStatus(newStatus);
// AirflowDirection - Front - 2 (FACE)
$("#fan_dir_right_btn").bind('click', function() {
var currentStatus = bootstrap.carIndicator.status.airflowDirection;
- if ((currentStatus >= 0) && (currentStatus <= 7)){ // && (bootstrap.carIndicator.status.fanSpeed !== 0)) {
+ if ((currentStatus >= 0) && (currentStatus <= 7) && (bootstrap.carIndicator.status.fanSpeed !== 0)) {
var newStatus = changeAirflowDirectionStatus("#fan_dir_right_btn", currentStatus, 2);
hvacControler.prototype.onAirflowDirectionChanged(2);
setAirFlowDirectionStatus(newStatus);
});
// Defrost - Rear
$("#defrost_rear_btn").bind('click', function() {
- bootstrap.carIndicator.status.rearDefrost = !bootstrap.carIndicator.status.rearDefrost;
- hvacControler.prototype.onRearDefrostChanged(bootstrap.carIndicator.status.rearDefrost);
-
bootstrap.carIndicator.setStatus("rearDefrost", !bootstrap.carIndicator.status.rearDefrost);
});
// Defrost - Front
$("#defrost_front_btn").bind('click', function() {
- bootstrap.carIndicator.status.frontDefrost = !bootstrap.carIndicator.status.frontDefrost;
- hvacControler.prototype.onFrontDefrostChanged(bootstrap.carIndicator.status.frontDefrost);
-
bootstrap.carIndicator.setStatus("frontDefrost", !bootstrap.carIndicator.status.frontDefrost);
});
};
$("#noPairedDevice").show();
} else {
$("#noPairedDevice").hide();
- $("#loadingHistorySpinnerWrapper").show();
$(".caroufredsel_wrapper").show();
}
});
Phone.loadContacts(function(err) {
if (!err) {
ContactsLibrary.init();
+ $("#loadingHistorySpinnerWrapper").show();
Phone.loadCallHistory(function(err) {
+ $("#loadingHistorySpinnerWrapper").hide();
if (!err) {
- $("#loadingHistorySpinnerWrapper").hide();
callHistoryCarousel.loadCallHistory(Phone.callHistory(), 0);
}
});
if (acceptPhoneCallFromOtherWidget !== true) {
window.setTimeout(function() {
Phone.loadCallHistory(function(err) {
+ $("#loadingHistorySpinnerWrapper").hide();
if (!err) {
- $("#loadingHistorySpinnerWrapper").hide();
callHistoryCarousel.loadCallHistory(Phone.callHistory(), 0);
}