mirror of
https://github.com/pretix/pretix.git
synced 2026-05-08 15:44:02 +00:00
moved update()-event to checkboxes’ change-event, added row-highlight if selected
This commit is contained in:
@@ -689,6 +689,8 @@ $(function () {
|
|||||||
if (!checkbox.hasAttribute("data-inital")) checkbox.setAttribute("data-inital", checkbox.checked);
|
if (!checkbox.hasAttribute("data-inital")) checkbox.setAttribute("data-inital", checkbox.checked);
|
||||||
if (checked === undefined || checked === null) checkbox.checked = checkbox.getAttribute("data-inital") === "true";
|
if (checked === undefined || checked === null) checkbox.checked = checkbox.getAttribute("data-inital") === "true";
|
||||||
else checkbox.checked = checked;
|
else checkbox.checked = checked;
|
||||||
|
|
||||||
|
$(checkbox).trigger("change");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var onChangeSelection = function(ev) {
|
var onChangeSelection = function(ev) {
|
||||||
@@ -732,7 +734,6 @@ $(function () {
|
|||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
onChangeSelectionHappened = false;
|
onChangeSelectionHappened = false;
|
||||||
$checkboxes.removeAttr("data-inital");
|
$checkboxes.removeAttr("data-inital");
|
||||||
update();
|
|
||||||
}
|
}
|
||||||
$rows.off("pointerenter", onChangeSelection);
|
$rows.off("pointerenter", onChangeSelection);
|
||||||
});
|
});
|
||||||
@@ -754,9 +755,12 @@ $(function () {
|
|||||||
$toggle.prop("checked", all_same).prop("indeterminate", false);
|
$toggle.prop("checked", all_same).prop("indeterminate", false);
|
||||||
};
|
};
|
||||||
|
|
||||||
$(this).closest("table").find("td:first-child input[type=checkbox]").change(update);
|
$checkboxes.change(function() {
|
||||||
|
$(this).closest("tr").toggleClass("warning", this.checked);
|
||||||
|
update();
|
||||||
|
});
|
||||||
$(this).change(function (ev) {
|
$(this).change(function (ev) {
|
||||||
$(this).closest("table").find("td:first-child input[type=checkbox]").prop("checked", $(this).prop("checked"));
|
$checkboxes.prop("checked", this.checked).trigger("change");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user