aboutsummaryrefslogtreecommitdiff
path: root/basicConfig/webcontent/js/js_country.js
diff options
context:
space:
mode:
authorThomas <>2022-06-03 16:02:01 +0200
committerThomas <>2022-06-03 16:02:01 +0200
commit9d1d6626032aa59eb169e310ed239b94c0bc5447 (patch)
tree4ecbdce1b177ae5380b0470555d4fb90297e26ff /basicConfig/webcontent/js/js_country.js
parent7f0a925a72dc9841280e66fcba1515af62b9efdf (diff)
downloadNational_eIDAS_Gateway-9d1d6626032aa59eb169e310ed239b94c0bc5447.tar.gz
National_eIDAS_Gateway-9d1d6626032aa59eb169e310ed239b94c0bc5447.tar.bz2
National_eIDAS_Gateway-9d1d6626032aa59eb169e310ed239b94c0bc5447.zip
chore(config): split default configuration into MS-Connector and MS-Proxy-Servie
Diffstat (limited to 'basicConfig/webcontent/js/js_country.js')
-rw-r--r--basicConfig/webcontent/js/js_country.js42
1 files changed, 0 insertions, 42 deletions
diff --git a/basicConfig/webcontent/js/js_country.js b/basicConfig/webcontent/js/js_country.js
deleted file mode 100644
index 5dcea90e..00000000
--- a/basicConfig/webcontent/js/js_country.js
+++ /dev/null
@@ -1,42 +0,0 @@
-function clickCountryFlag(element) {
- if (!element) return false;
-
- var form = element.target.closest("form");
-
- if (!form) return false;
-
- form.submit();
- return false;
-}
-
-
-/* Set JS events by EventListener to prevent problems with CSP*/
-document.addEventListener("DOMContentLoaded", function(event) {
-
- /* Element.closest polyfill - https://developer.mozilla.org/en-US/docs/Web/API/Element/closest License: public domain*/
- if (!Element.prototype.matches)
- Element.prototype.matches = Element.prototype.msMatchesSelector ||
- Element.prototype.webkitMatchesSelector;
-
- if (!Element.prototype.closest)
- Element.prototype.closest = function(s) {
- var el = this;
- if (!document.documentElement.contains(el)) return null;
- do {
- if (el.matches(s)) return el;
- el = el.parentElement || el.parentNode;
- } while (el !== null && el.nodeType === 1);
- return null;
- };
-
- /* set Click events by EventListener to prevent JavaScript in HTML which can be a problem with CSP*/
- var allFlags = document.getElementsByClassName("countryimage");
- for (i=0;i<allFlags.length;i++) {
- if(allFlags[i].getAttribute("disabled") == null) {
- allFlags[i].closest("a").addEventListener('click', clickCountryFlag, false);
- }
- }
-});
-
-
-