mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Removed "Both" column from Content recipe builder step.
This commit is contained in:
@@ -1,63 +1,25 @@
|
|||||||
(function($) {
|
(function($) {
|
||||||
$(function() {
|
$(function () {
|
||||||
$("table.items").each(function() {
|
$("table.items thead tr input[type='checkbox'].check-all-in-column").each(function () {
|
||||||
var table = $(this);
|
var master = $(this);
|
||||||
|
var columnIndex = master.closest("th").index() + 1;
|
||||||
|
var slaves = master.closest("table").find("tbody tr td:nth-child(" + columnIndex + ") input[type='checkbox']:not(:disabled)");
|
||||||
|
|
||||||
table.on("click", ".check-schema, .check-data", function (e) {
|
var updateMaster = function () {
|
||||||
updateState();
|
var allChecked = slaves.filter(":not(:checked)").length == 0;
|
||||||
|
master.prop("checked", allChecked);
|
||||||
|
}
|
||||||
|
|
||||||
|
master.on("change", function () {
|
||||||
|
var isChecked = $(this).is(":checked");
|
||||||
|
slaves.prop("checked", isChecked);
|
||||||
});
|
});
|
||||||
|
|
||||||
table.on("click", ".check-both", function (e) {
|
slaves.on("change", function () {
|
||||||
var sender = $(this);
|
updateMaster();
|
||||||
var isChecked = sender.is(":checked");
|
|
||||||
var row = sender.closest("tr");
|
|
||||||
|
|
||||||
row.find(".check-schema, .check-data").prop("checked", isChecked);
|
|
||||||
updateState();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
table.on("click", ".check-all-schema", function (e) {
|
updateMaster();
|
||||||
var sender = $(this);
|
|
||||||
var isChecked = sender.is(":checked");
|
|
||||||
|
|
||||||
table.find(".check-schema").prop("checked", isChecked);
|
|
||||||
updateState();
|
|
||||||
});
|
|
||||||
|
|
||||||
table.on("click", ".check-all-data", function (e) {
|
|
||||||
var sender = $(this);
|
|
||||||
var isChecked = sender.is(":checked");
|
|
||||||
|
|
||||||
table.find(".check-data").prop("checked", isChecked);
|
|
||||||
updateState();
|
|
||||||
});
|
|
||||||
|
|
||||||
table.on("click", ".check-all-both", function (e) {
|
|
||||||
var sender = $(this);
|
|
||||||
var isChecked = sender.is(":checked");
|
|
||||||
|
|
||||||
table.find(".check-schema").prop("checked", isChecked);
|
|
||||||
table.find(".check-data").prop("checked", isChecked);
|
|
||||||
updateState();
|
|
||||||
});
|
|
||||||
|
|
||||||
var updateState = function () {
|
|
||||||
table.find("tbody tr").each(function() {
|
|
||||||
var tr = $(this);
|
|
||||||
var checkSchema = tr.find(".check-schema").is(":checked");
|
|
||||||
var checkData = tr.find(".check-data").is(":checked");
|
|
||||||
|
|
||||||
tr.find(".check-both").prop("checked", checkSchema && checkData);
|
|
||||||
});
|
|
||||||
|
|
||||||
var allBothChecked = table.find(".check-both").not(":checked").length === 0;
|
|
||||||
var allSchemaChecked = table.find(".check-schema").not(":checked").length === 0;
|
|
||||||
var allDataChecked = table.find(".check-data").not(":checked").length === 0;
|
|
||||||
|
|
||||||
table.find(".check-all-both").prop("checked", allBothChecked);
|
|
||||||
table.find(".check-all-schema").prop("checked", allSchemaChecked);
|
|
||||||
table.find(".check-all-data").prop("checked", allDataChecked);
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})(jQuery);
|
})(jQuery);
|
@@ -11,13 +11,11 @@
|
|||||||
<th>@T("Content Type")</th>
|
<th>@T("Content Type")</th>
|
||||||
<th>@T("Schema")</th>
|
<th>@T("Schema")</th>
|
||||||
<th>@T("Data")</th>
|
<th>@T("Data")</th>
|
||||||
<th>@T("Both")</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="sub">
|
<tr class="sub">
|
||||||
<th> </th>
|
<th> </th>
|
||||||
<th><input type="checkbox" class="check-all-schema" /></th>
|
<th><input type="checkbox" class="check-all-in-column" /></th>
|
||||||
<th><input type="checkbox" class="check-all-data" /></th>
|
<th><input type="checkbox" class="check-all-in-column" /></th>
|
||||||
<th><input type="checkbox" class="check-all-both" /></th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -32,7 +30,6 @@
|
|||||||
<td>
|
<td>
|
||||||
<input type="checkbox" class="check-data" name="@Html.NameFor(m => m.ContentTypes[contentTypeIndex].ExportData)" value="true" />
|
<input type="checkbox" class="check-data" name="@Html.NameFor(m => m.ContentTypes[contentTypeIndex].ExportData)" value="true" />
|
||||||
</td>
|
</td>
|
||||||
<td><input type="checkbox" class="check-both" /></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
contentTypeIndex++;
|
contentTypeIndex++;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user