Display squad numbers in defense section and sync statistics when editing event

This commit is contained in:
Brian Miyaji
2016-05-06 22:07:49 +10:00
parent 10bc50d5ad
commit c8a9e1df89
3 changed files with 35 additions and 15 deletions

View File

@@ -262,6 +262,26 @@ jQuery(document).ready(function($){
// Trigger total stats calculator
$(".sp-data-table .sp-total input").trigger("updateTotal");
// Sync inputs
$(".sp-sync-input").on("keyup", function() {
name = $(this).attr("name");
$el = $("input[name='"+name+"']");
if ( $el.length > 1 ) {
val = $(this).val();
$el.val(val);
}
});
// Sync selects
$(".sp-sync-select").on("change", function() {
name = $(this).attr("name");
$el = $("select[name='"+name+"']")
if ( $el.length > 1 ) {
val = $(this).val();
$el.val(val);
}
});
// Select all checkboxes
$(".sp-select-all-range").on("change", ".sp-select-all", function() {
$range = $(this).closest(".sp-select-all-range");