Created
September 4, 2019 04:57
-
-
Save anakaine/c787fd4cb524630063d1a68b1f7f3b9e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).on('click', '.gv-button-delete', async function (e) { | |
e.preventDefault(); //prevent submission | |
console.log('Intercepted delete button request'); | |
var delLoc = ""; | |
(function ($) { | |
var delLoc2 = $('.gv-button-delete').attr("href"); //capture default action, because we need the time-valid nonce | |
delLoc = delLoc2; | |
}(jQuery)); | |
var objID = document.getElementById("input_4_40").value; | |
objID = parseInt(objID); | |
var iframe = document.getElementById("MapFrame1"); | |
if (iframe) { | |
var iframeContent = (iframe.contentWindow || iframe.contentDocument); | |
//var result = iframeContent.WriteLog(objID); //call the fucntion from the iframe, and hopefully wait for a result. | |
var result = await f(iframeContent, objID); | |
console.log(result); | |
} | |
if (result == "error") { | |
console.log("Step 5") | |
console.log("There was an error with removing the feature"); | |
} else if (result == "ok") { | |
console.log("Step 5") | |
console.log("The spatial delete completed correctly"); | |
} else { | |
console.log("Step 5") | |
console.log("unexpected result of spatial delete") | |
} | |
}); | |
async function f(iframeContent, objID) { | |
var result = iframeContent.WriteLog(objID); //call the fucntion from the iframe, and hopefully wait for a result. | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment