mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-03-04 03:10:50 +01:00
increase compatibility of javascript migration code
* replace const with var * replace forEach with a for of loop * use === instead of ==
This commit is contained in:
@@ -48,12 +48,12 @@
|
||||
{{$script}}
|
||||
<script>
|
||||
setInterval(function () {
|
||||
const request = new XMLHttpRequest();
|
||||
var request = new XMLHttpRequest();
|
||||
|
||||
request.open('GET', '{{ contextPath }}/api/v2/', true);
|
||||
|
||||
request.onload = function () {
|
||||
if (this.readyState == 4 && this.status == 200 && this.response.toString().indexOf("_links") > 0) {
|
||||
if (this.readyState === 4 && this.status === 200 && this.response.toString().indexOf("_links") > 0) {
|
||||
location.href = '{{ contextPath }}';
|
||||
}
|
||||
};
|
||||
|
||||
@@ -90,12 +90,12 @@
|
||||
{{$script}}
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
const changeAllSelector = document.getElementById('changeAll');
|
||||
var changeAllSelector = document.getElementById('changeAll');
|
||||
changeAllSelector.onchange = function () {
|
||||
const strategySelects = document.getElementsByClassName('strategy-select');
|
||||
console.log("selects:", strategySelects);
|
||||
console.log("setting to:", changeAllSelector.value);
|
||||
Array.prototype.forEach.call(strategySelects, s => s.value = changeAllSelector.value);
|
||||
var strategySelects = document.getElementsByClassName('strategy-select');
|
||||
for (var strategySelect of strategySelects) {
|
||||
strategySelect.value = changeAllSelector.value;
|
||||
}
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user