mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-03-11 14:53:34 +08:00
Add Loading when click submit
This commit is contained in:
parent
cee6f8949c
commit
8728af4332
2 changed files with 52 additions and 3 deletions
|
@ -21,10 +21,32 @@
|
|||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.select2').select2({theme: "bootstrap"});
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$('.select2tag').select2({theme: "bootstrap", tags: true});
|
||||
var listAtts = document.querySelectorAll(`button[type="submit"]`);
|
||||
listAtts.forEach(function(el) {
|
||||
if (el.addEventListener) { // all browsers except IE before version 9
|
||||
el.addEventListener("click", function() {
|
||||
$(this).html(
|
||||
`<span class="glyphicon glyphicon-refresh" role="status" aria-hidden="true"></span>`
|
||||
);
|
||||
setTimeout(() => {
|
||||
$(this).prop("disabled", true);
|
||||
}, 100);
|
||||
}, false);
|
||||
} else {
|
||||
if (el.attachEvent) { // IE before version 9
|
||||
el.attachEvent("click", function() {
|
||||
$(this).html(
|
||||
`<span class="glyphicon glyphicon-refresh" role="status" aria-hidden="true"></span>`
|
||||
);
|
||||
setTimeout(() => {
|
||||
$(this).prop("disabled", true);
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
var listAtts = document.querySelectorAll(`[api-get-text]`);
|
||||
|
|
|
@ -79,6 +79,33 @@
|
|||
el.innerHTML = data;
|
||||
});
|
||||
});
|
||||
$(document).ready(function() {
|
||||
var listAtts = document.querySelectorAll(`button[type="submit"]`);
|
||||
listAtts.forEach(function(el) {
|
||||
if (el.addEventListener) { // all browsers except IE before version 9
|
||||
el.addEventListener("click", function() {
|
||||
$(this).html(
|
||||
`<span class="glyphicon glyphicon-refresh" role="status" aria-hidden="true"></span>`
|
||||
);
|
||||
setTimeout(() => {
|
||||
$(this).prop("disabled", true);
|
||||
}, 100);
|
||||
}, false);
|
||||
} else {
|
||||
if (el.attachEvent) { // IE before version 9
|
||||
el.attachEvent("click", function() {
|
||||
$(this).html(
|
||||
`<span class="glyphicon glyphicon-refresh" role="status" aria-hidden="true"></span>`
|
||||
);
|
||||
setTimeout(() => {
|
||||
$(this).prop("disabled", true);
|
||||
}, 100);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
||||
|
||||
|
|
Loading…
Reference in a new issue