v30495092 fix attribute href

This commit is contained in:
2019-01-11 02:33:01 +01:00
parent 06ab23bdca
commit e8da6536d9
3 changed files with 46 additions and 30 deletions

View File

@@ -1465,26 +1465,34 @@ class AutomaticDispose {
CollectInvolvedVehicles() {
let self = this;
$("#mission_vehicle_driving tbody").find("tr").each(function (_, elem) {
var VehicleID = $(elem).find("a").first().attr("href").substr($(elem).find("a").first().attr("href").lastIndexOf("/") + 1);
var VehicleName = $(elem).find("a").first().text();
var VehicleType = $(elem).find("a").first().attr("vehicle_type_id");
var f = $(elem).find("a").first()
var attr = f.attr("href")
if (typeof attr !== 'undefined' && attr !== false) {
var VehicleID = f.attr("href").substr(f.attr("href").lastIndexOf("/") + 1);
var VehicleName = f.text();
var VehicleType = f.attr("vehicle_type_id");
self.Vehicles[VehicleID] = {
"id": VehicleID,
"name": VehicleName,
"type": VehicleType
self.Vehicles[VehicleID] = {
"id": VehicleID,
"name": VehicleName,
"type": VehicleType
}
}
});
$("#mission_vehicle_at_mission tbody").find("tr").each(function (_, elem) {
var VehicleID = $(elem).find("a").first().attr("href").substr($(elem).find("a").first().attr("href").lastIndexOf("/") + 1);
var VehicleName = $(elem).find("a").first().text();
var VehicleType = $(elem).find("a").first().attr("vehicle_type_id");
var f = $(elem).find("a").first()
var attr = f.attr("href")
if (typeof attr !== 'undefined' && attr !== false) {
var VehicleID = f.attr("href").substr(f.attr("href").lastIndexOf("/") + 1);
var VehicleName = f.text();
var VehicleType = f.attr("vehicle_type_id");
self.Vehicles[VehicleID] = {
"id": VehicleID,
"name": VehicleName,
"type": VehicleType
self.Vehicles[VehicleID] = {
"id": VehicleID,
"name": VehicleName,
"type": VehicleType
}
}
});