mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
148: Added "enable all" checkbox to each category.
This commit is contained in:
@@ -1,10 +1,44 @@
|
||||
(function($) {
|
||||
// Initialize Expando control
|
||||
$(".expando-wrapper legend").expandoControl(
|
||||
function (controller) {
|
||||
return controller.nextAll(".expando");
|
||||
}, {
|
||||
collapse: true,
|
||||
remember: true
|
||||
|
||||
var initExpandoControl = function() {
|
||||
// Initialize Expando control
|
||||
$(".expando-wrapper legend").expandoControl(
|
||||
function(controller) {
|
||||
return controller.nextAll(".expando");
|
||||
}, {
|
||||
collapse: true,
|
||||
remember: true
|
||||
});
|
||||
};
|
||||
|
||||
var initCheckAll = function() {
|
||||
// Check all / uncheck all.
|
||||
$("table.check-all").each(function() {
|
||||
var table = $(this);
|
||||
var controller = table.find("thead input[type=\"checkbox\"]");
|
||||
var checkboxes = table.find("tbody input[type=\"checkbox\"]");
|
||||
|
||||
var updateController = function () {
|
||||
var allChecked = checkboxes.filter(":not(:checked)").length == 0;
|
||||
controller.prop("checked", allChecked);
|
||||
}
|
||||
|
||||
table.on("change", "thead input[type=\"checkbox\"]", function() {
|
||||
var isChecked = $(this).is(":checked");
|
||||
checkboxes.prop("checked", isChecked);
|
||||
});
|
||||
|
||||
table.on("change", "tbody input[type=\"checkbox\"]", function () {
|
||||
updateController();
|
||||
});
|
||||
|
||||
updateController();
|
||||
});
|
||||
};
|
||||
|
||||
$(function() {
|
||||
initExpandoControl();
|
||||
initCheckAll();
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
@@ -1,6 +1,9 @@
|
||||
@model Orchard.AuditTrail.ViewModels.AuditTrailSettingsViewModel
|
||||
@{
|
||||
Style.Include("admin.css");
|
||||
Script.Require("ShapesBase");
|
||||
Script.Include("~/Themes/TheAdmin/scripts/admin.js").AtFoot();
|
||||
Script.Include("audit-trail-admin.js").AtFoot();
|
||||
}
|
||||
<div class="audit-trail-site-settings">
|
||||
<fieldset>
|
||||
@@ -12,12 +15,17 @@
|
||||
<fieldset>
|
||||
<legend>@category.Name</legend>
|
||||
<input type="hidden" name="AuditTrailSettingsPart.Categories[@i].Category" value="@category.Category" />
|
||||
<table class="items">
|
||||
<table class="items check-all">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="event-name">@T("Event")</th>
|
||||
<th>@T("Description")</th>
|
||||
<th class="event-enabled">@T("Enabled")</th>
|
||||
<th class="event-enabled">
|
||||
<label>
|
||||
<input type="checkbox"/>
|
||||
@T("Enabled")
|
||||
</label>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@{ var j = 0; }
|
||||
|
||||
Reference in New Issue
Block a user