Skip to content

Commit

Permalink
CodeStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
fisharebest committed Oct 1, 2021
1 parent 551ad4a commit 8c13cfd
Show file tree
Hide file tree
Showing 7 changed files with 239 additions and 239 deletions.
68 changes: 34 additions & 34 deletions resources/views/modals/create-location.phtml
Expand Up @@ -23,42 +23,42 @@ use Fisharebest\Webtrees\Tree;
</form>

<script>
// Submit the modal form using AJAX
document.getElementById("wt-modal-form").addEventListener("submit", function (event) {
event.preventDefault();
let form = event.target;
let modal_content = document.querySelector("#wt-ajax-modal .modal-content");
let select = document.getElementById(modal_content.dataset.wtSelectId);
// Submit the modal form using AJAX
document.getElementById('wt-modal-form').addEventListener('submit', function (event) {
event.preventDefault();
let form = event.target;
let modal_content = document.querySelector('#wt-ajax-modal .modal-content');
let select = document.getElementById(modal_content.dataset.wtSelectId);

$.ajax({
url: form.action,
type: form.method,
data: new FormData(form),
async: false,
cache: false,
contentType: false,
processData: false,
success: function (data) {
if (select) {
// If this modal was activated by the "new" button in a select2
// edit control, then insert the result and select it.
let option = new Option(data.text, data.id, true, true);
option.innerHTML = option.innerText;
$.ajax({
url: form.action,
type: form.method,
data: new FormData(form),
async: false,
cache: false,
contentType: false,
processData: false,
success: function (data) {
if (select) {
// If this modal was activated by the "new" button in a select2
// edit control, then insert the result and select it.
let option = new Option(data.text, data.id, true, true);
option.innerHTML = option.innerText;

$(select)
.select2({ escapeMarkup: (x) => x })
.empty()
.append(option)
.trigger("change");
$(select)
.select2({ escapeMarkup: (x) => x })
.empty()
.append(option)
.trigger('change');

$("#wt-ajax-modal").modal("hide");
} else {
modal_content.innerHTML = data.html;
}
},
failure: function (data) {
modal_content.innerHTML = data.html;
},
});
$('#wt-ajax-modal').modal('hide');
} else {
modal_content.innerHTML = data.html;
}
},
failure: function (data) {
modal_content.innerHTML = data.html;
},
});
});
</script>
68 changes: 34 additions & 34 deletions resources/views/modals/create-media-object.phtml
Expand Up @@ -26,42 +26,42 @@ use Fisharebest\Webtrees\Tree;
</form>

<script>
// Submit the modal form using AJAX
document.getElementById("wt-modal-form").addEventListener("submit", function (event) {
event.preventDefault();
let form = event.target;
let modal_content = document.querySelector("#wt-ajax-modal .modal-content");
let select = document.getElementById(modal_content.dataset.wtSelectId);
// Submit the modal form using AJAX
document.getElementById('wt-modal-form').addEventListener('submit', function (event) {
event.preventDefault();
let form = event.target;
let modal_content = document.querySelector('#wt-ajax-modal .modal-content');
let select = document.getElementById(modal_content.dataset.wtSelectId);

$.ajax({
url: form.action,
type: form.method,
data: new FormData(form),
async: false,
cache: false,
contentType: false,
processData: false,
success: function (data) {
if (select) {
// If this modal was activated by the "new" button in a select2
// edit control, then insert the result and select it.
let option = new Option(data.text, data.id, true, true);
option.innerHTML = option.innerText;
$.ajax({
url: form.action,
type: form.method,
data: new FormData(form),
async: false,
cache: false,
contentType: false,
processData: false,
success: function (data) {
if (select) {
// If this modal was activated by the "new" button in a select2
// edit control, then insert the result and select it.
let option = new Option(data.text, data.id, true, true);
option.innerHTML = option.innerText;

$(select)
.select2({ escapeMarkup: (x) => x })
.empty()
.append(option)
.trigger("change");
$(select)
.select2({ escapeMarkup: (x) => x })
.empty()
.append(option)
.trigger('change');

$("#wt-ajax-modal").modal("hide");
} else {
modal_content.innerHTML = data.html;
}
},
failure: function (data) {
modal_content.innerHTML = data.html;
},
});
$('#wt-ajax-modal').modal('hide');
} else {
modal_content.innerHTML = data.html;
}
},
failure: function (data) {
modal_content.innerHTML = data.html;
},
});
});
</script>
70 changes: 35 additions & 35 deletions resources/views/modals/create-note-object.phtml
Expand Up @@ -23,43 +23,43 @@ use Fisharebest\Webtrees\Tree;
</form>

<script>
// Submit the modal form using AJAX
document.getElementById("wt-modal-form").addEventListener("submit", function (event) {
event.preventDefault();
let form = event.target;
let modal_content = document.querySelector("#wt-ajax-modal .modal-content");
let select = document.getElementById(modal_content.dataset.wtSelectId);
// Submit the modal form using AJAX
document.getElementById('wt-modal-form').addEventListener('submit', function (event) {
event.preventDefault();
let form = event.target;
let modal_content = document.querySelector('#wt-ajax-modal .modal-content');
let select = document.getElementById(modal_content.dataset.wtSelectId);

$.ajax({
url: form.action,
type: form.method,
data: new FormData(form),
async: false,
cache: false,
contentType: false,
processData: false,
success: function (data) {
if (select) {
// If this modal was activated by the "new" button in a select2
// edit control, then insert the result and select it.
let option = new Option(data.text, data.id, true, true);
option.innerHTML = option.innerText;
option.innerHTML = data.text;
$.ajax({
url: form.action,
type: form.method,
data: new FormData(form),
async: false,
cache: false,
contentType: false,
processData: false,
success: function (data) {
if (select) {
// If this modal was activated by the "new" button in a select2
// edit control, then insert the result and select it.
let option = new Option(data.text, data.id, true, true);
option.innerHTML = option.innerText;
option.innerHTML = data.text;

$(select)
.select2({ escapeMarkup: (x) => x })
.empty()
.append(option)
.trigger("change");
$(select)
.select2({ escapeMarkup: (x) => x })
.empty()
.append(option)
.trigger('change');

$("#wt-ajax-modal").modal("hide");
} else {
modal_content.innerHTML = data.html;
}
},
failure: function (data) {
modal_content.innerHTML = data.html;
},
});
$('#wt-ajax-modal').modal('hide');
} else {
modal_content.innerHTML = data.html;
}
},
failure: function (data) {
modal_content.innerHTML = data.html;
},
});
});
</script>
68 changes: 34 additions & 34 deletions resources/views/modals/create-repository.phtml
Expand Up @@ -25,42 +25,42 @@ use Fisharebest\Webtrees\Tree;
</form>

<script>
// Submit the modal form using AJAX
document.getElementById("wt-modal-form").addEventListener("submit", function (event) {
event.preventDefault();
let form = event.target;
let modal_content = document.querySelector("#wt-ajax-modal .modal-content");
let select = document.getElementById(modal_content.dataset.wtSelectId);
// Submit the modal form using AJAX
document.getElementById('wt-modal-form').addEventListener('submit', function (event) {
event.preventDefault();
let form = event.target;
let modal_content = document.querySelector('#wt-ajax-modal .modal-content');
let select = document.getElementById(modal_content.dataset.wtSelectId);

$.ajax({
url: form.action,
type: form.method,
data: new FormData(form),
async: false,
cache: false,
contentType: false,
processData: false,
success: function (data) {
if (select) {
// If this modal was activated by the "new" button in a select2
// edit control, then insert the result and select it.
let option = new Option(data.text, data.id, true, true);
option.innerHTML = option.innerText;
$.ajax({
url: form.action,
type: form.method,
data: new FormData(form),
async: false,
cache: false,
contentType: false,
processData: false,
success: function (data) {
if (select) {
// If this modal was activated by the "new" button in a select2
// edit control, then insert the result and select it.
let option = new Option(data.text, data.id, true, true);
option.innerHTML = option.innerText;

$(select)
.select2({ escapeMarkup: (x) => x })
.empty()
.append(option)
.trigger("change");
$(select)
.select2({ escapeMarkup: (x) => x })
.empty()
.append(option)
.trigger('change');

$("#wt-ajax-modal").modal("hide");
} else {
modal_content.innerHTML = data.html;
}
},
failure: function (data) {
modal_content.innerHTML = data.html;
},
});
$('#wt-ajax-modal').modal('hide');
} else {
modal_content.innerHTML = data.html;
}
},
failure: function (data) {
modal_content.innerHTML = data.html;
},
});
});
</script>
68 changes: 34 additions & 34 deletions resources/views/modals/create-source.phtml
Expand Up @@ -23,42 +23,42 @@ use Fisharebest\Webtrees\Tree;
</form>

<script>
// Submit the modal form using AJAX
document.getElementById("wt-modal-form").addEventListener("submit", function (event) {
event.preventDefault();
let form = event.target;
let modal_content = document.querySelector("#wt-ajax-modal .modal-content");
let select = document.getElementById(modal_content.dataset.wtSelectId);
// Submit the modal form using AJAX
document.getElementById('wt-modal-form').addEventListener('submit', function (event) {
event.preventDefault();
let form = event.target;
let modal_content = document.querySelector('#wt-ajax-modal .modal-content');
let select = document.getElementById(modal_content.dataset.wtSelectId);

$.ajax({
url: form.action,
type: form.method,
data: new FormData(form),
async: false,
cache: false,
contentType: false,
processData: false,
success: function (data) {
if (select) {
// If this modal was activated by the "new" button in a select2
// edit control, then insert the result and select it.
let option = new Option(data.text, data.id, true, true);
option.innerHTML = option.innerText;
$.ajax({
url: form.action,
type: form.method,
data: new FormData(form),
async: false,
cache: false,
contentType: false,
processData: false,
success: function (data) {
if (select) {
// If this modal was activated by the "new" button in a select2
// edit control, then insert the result and select it.
let option = new Option(data.text, data.id, true, true);
option.innerHTML = option.innerText;

$(select)
.select2({ escapeMarkup: (x) => x })
.empty()
.append(option)
.trigger("change");
$(select)
.select2({ escapeMarkup: (x) => x })
.empty()
.append(option)
.trigger('change');

$("#wt-ajax-modal").modal("hide");
} else {
modal_content.innerHTML = data.html;
}
},
failure: function (data) {
modal_content.innerHTML = data.html;
},
});
$('#wt-ajax-modal').modal('hide');
} else {
modal_content.innerHTML = data.html;
}
},
failure: function (data) {
modal_content.innerHTML = data.html;
},
});
});
</script>

0 comments on commit 8c13cfd

Please sign in to comment.