add handling of AB containers

This commit is contained in:
2019-01-21 05:49:09 +01:00
parent 61e1535237
commit 58d71e7038
4 changed files with 35 additions and 11 deletions

View File

@@ -152,7 +152,8 @@ class AutomaticDispose {
// - Sprechwunsch Handler Rettung
// -
if (window.location.pathname.indexOf("/vehicles/") !== -1 && window.name == 'adis-sprechwunsch-rescue') {
self.Check_Call_Hospitals();
self.Check_Call_AB_Active(); // else
//self.Check_Call_Hospitals();
}
// -
@@ -470,16 +471,27 @@ class AutomaticDispose {
Check_Call_Police_Active() {
let self = this;
if ($('#h2_prisoners').length > 0) {
this.Collect_Jails();
self.Collect_Jails();
} else {
let MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1);
// console.log('Check_Call_Police_Active', MissionID)
this.RemovePoliceSprechwunschFromQueue(MissionID).then((deleteCount) => {
self.RemovePoliceSprechwunschFromQueue(MissionID).then((deleteCount) => {
tellParent(`console.log('sprechwunsch:${window.name}:${MissionID}');setTimeout(function(){ window.AutomaticDisposeCall.FreeIframe('adis-sprechwunsch-police-frame');},250);`);
});
}
}
Check_Call_AB_Active() {
let self = this;
if ($('#iframe-inside-container > h1').length > 0 && $("#iframe-inside-container > div.row > div.alert.alert-info:contains('Welches Zugfahrzeug soll zum Transport genutzt werden')").length > 0) {
$("#vehicle_show_table > tbody > tr > td:nth-child(1) > a:contains('Alarmieren')").first().click();
} else {
self.Check_Call_Hospitals();
}
}
// Gefängnis auswählen
Collect_Jails() {
@@ -2452,7 +2464,7 @@ $(document).ready(function () {
if ($div.length && isShow) {
var observer = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
console.log(mutation)
//console.log(mutation)
if (mutation.attributeName === "style") {
if ($(mutation.target).css('display') == 'none') {
if (typeof ppppp != 'undefined') {