Of course
watchUtils.when(app.view.popup, "selectedFeature", function photos(evt) {
var x = document.getElementById("attInventory");
x.style.display = "none";
query("#panelInfo").removeClass("in");
query("#panelDetails").removeClass("in");
query("#panelInventory").removeClass("in");
console.log(app.view.popup.actions);
app.view.popup.actions.splice(1, 2);
app.view.popup.actions.push(wellInventory);
objectID = app.view.popup.selectedFeature.attributes.OBJECTID;
var queryTask = new QueryTask({
url: "https://services.arcgis.com/FeatureServer/0"
});
relationQuery = new RelationshipQuery({
objectIds: [objectID],
outFields: ["Filename", "directory", "TYPE", "Usage", "Top_Depth", "Bottom_Depth"],
returnGeometry: true,
relationshipId: 1
});
queryTask.executeRelationshipQuery(relationQuery).then(function(rslts) {
document.getElementById("attDetails").innerHTML = "";
var features = rslts[objectID].features;
if (features) {
app.view.popup.actions.push(corePhotos);
} else {
query("#panelDetails").removeClass("in");
query("#collapseDetails").removeClass("in");
}
features.forEach(function(ftr) {
var t = ftr.attributes;
var string = t.directory + t.Filename;
var name = t.Filename;
var type = t.TYPE;
var display = t.Usage;
var tDepth = t.Top_Depth;
var bDepth = t.Bottom_Depth;
if (display == "PUBLIC" && name.match(/.jpg/)) {
document.getElementById("attDetails").innerHTML += "<li><img data-original='https://core_photos/" + string + "' src='https://core_photos/" + string + "' width='200' height='125' alt='" + type + " Top Depth: " + tDepth + " Bottom Depth: " + bDepth + "'></li>";
}
});
});
});