Tweak selector for auto-calculating totals
This commit is contained in:
@@ -239,7 +239,7 @@ jQuery(document).ready(function($){
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Total stats calculator
|
// Total stats calculator
|
||||||
$(".sp-data-table .sp-total input[data-sp-format=number][data-sp-total-type=total]").on("updateTotal", function() {
|
$(".sp-data-table .sp-total input[data-sp-format=number][data-sp-total-type!=average]").on("updateTotal", function() {
|
||||||
index = $(this).parent().index();
|
index = $(this).parent().index();
|
||||||
var sum = 0;
|
var sum = 0;
|
||||||
$(this).closest(".sp-data-table").find(".sp-post").each(function() {
|
$(this).closest(".sp-data-table").find(".sp-post").each(function() {
|
||||||
@@ -257,12 +257,12 @@ jQuery(document).ready(function($){
|
|||||||
// Activate total stats calculator
|
// Activate total stats calculator
|
||||||
if($(".sp-data-table .sp-total").size()) {
|
if($(".sp-data-table .sp-total").size()) {
|
||||||
$(".sp-data-table .sp-post td input").on("keyup", function() {
|
$(".sp-data-table .sp-post td input").on("keyup", function() {
|
||||||
$(this).closest(".sp-data-table").find(".sp-total td").eq($(this).parent().index()).find("input[data-sp-format=number][data-sp-total-type=total]").trigger("updateTotal");
|
$(this).closest(".sp-data-table").find(".sp-total td").eq($(this).parent().index()).find("input[data-sp-format=number][data-sp-total-type!=average]").trigger("updateTotal");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trigger total stats calculator
|
// Trigger total stats calculator
|
||||||
$(".sp-data-table .sp-total input[data-sp-format=number][data-sp-total-type=total]").trigger("updateTotal");
|
$(".sp-data-table .sp-total input[data-sp-format=number][data-sp-total-type!=average]").trigger("updateTotal");
|
||||||
|
|
||||||
// Sync inputs
|
// Sync inputs
|
||||||
$(".sp-sync-input").on("keyup", function() {
|
$(".sp-sync-input").on("keyup", function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user