pull/1002/head
Halil ibrahim Kalkan 6 years ago
commit 7d837e4dda

@ -9,7 +9,7 @@ VoloDocs is a cross-platform web application that allows you to easily create be
- Serves documents from your GitHub repository.
- Supports Markdown / HTML document formatting.
- Supports versioning (integrated to GitHub releases).
- Support multiple projects.
- Supports multiple projects.
- Allows users to edit a document on GitHub.
- Cross-platform; deployable to Windows / Linux / macOS.
@ -23,7 +23,7 @@ https://github.com/abpframework/abp/tree/master/modules/docs
You can download the VoloDocs release from the following link:
http://apps.abp.io/VoloDocs/VoloDocs.zip
http://apps.abp.io/VoloDocs/VoloDocs.zip *(will be ready soon...)*
## Folder Structure

@ -80,7 +80,7 @@ Then the route for getting a book will be '**/api/volosoft/book-store/book/{id}*
* Removing '**Async**' postfix. If the method name is 'GetPhonesAsync' then it becomes 'GetPhones'.
* Removing **HTTP method prefix**. 'GetList', 'GetAll', 'Get', 'Put', 'Update', 'Delete', 'Remove', 'Create', 'Add', 'Insert', 'Post' and 'Patch' prefixes are removed based on the selected HTTP method. So, 'GetPhones' becomes 'Phones' since 'Get' prefix is a duplicate for a GET request.
* Converting the result to **camelCase**.
* If the resulting action name is **empty** then it's not added to the route. If it's not empty, it's added to the route (like '/phones'). For 'GetAllAsync' method name it will be empty, for 'GetPhonesAsync' method name is will be 'phones'.
* If the resulting action name is **empty** then it's not added to the route. If it's not empty, it's added to the route (like '/phones'). For 'GetAllAsync' method name it will be empty, for 'GetPhonesAsync' method name it will be 'phones'.
* Normalization can be customized by setting the `UrlActionNameNormalizer` option. It's an action delegate that is called for every method.
* If there is another parameter with 'Id' postfix, then it's also added to the route as the final route segment (like '/phoneId').

@ -194,7 +194,7 @@ services.Configure<BundlingOptions>(options =>
options
.ScriptBundles
.Configure("MyGlobalBundle", bundle => {
bundle.AddContributors(typeof(MyExtensionStyleBundleContributor));
bundle.AddContributors(typeof(MyExtensionGlobalStyleContributor));
});
});
````
@ -279,9 +279,9 @@ public class MyExtensionStyleBundleContributor : BundleContributor
Using the built-in contributors for standard packages;
* Prevents you typing **invalid the resource paths**.
* Prevents you typing **the invalid resource paths**.
* Prevents changing your contributor if the resource **path changes** (the dependant contributor will handle it).
* Prevents multiple modules adding the **duplicate the files**.
* Prevents multiple modules adding the **duplicate files**.
* Manages **dependencies recursively** (adds dependencies of dependencies, if necessary).
#### Volo.Abp.AspNetCore.Mvc.UI.Packages Package

@ -196,7 +196,7 @@ services.Configure<BundlingOptions>(options =>
options
.ScriptBundles
.Configure("MyGlobalBundle", bundle => {
bundle.AddContributors(typeof(MyExtensionStyleBundleContributor));
bundle.AddContributors(typeof(MyExtensionGlobalStyleContributor));
});
});
````
@ -214,7 +214,7 @@ services.Configure<BundlingOptions>(options =>
`abp-style`和`abp-script`标签可以使用`type`属性(而不是`src`属性), 如本示例所示. 添加bundle贡献者时, 其依赖关系也会自动添加到bundle中.
#### Contributor Dependencies
#### 贡献者依赖关系
bundle贡献者可以与其他贡献者具有一个或多个依赖关系.
例如:
@ -227,9 +227,39 @@ public class MyExtensionStyleBundleContributor : BundleContributor
}
````
添加bundle贡献者时,其依赖关系将 **自动并递归** 添加. **依赖顺序** 通过阻止 **重复** 添加的依赖关系. 即使它们处于分离的中,也会阻止重复. ABP在页面中组织所有bundle并消除重复.
添加bundle贡献者时,其依赖关系将 **自动并递归** 添加. **依赖顺序** 通过阻止 **重复** 添加的依赖关系. 即使它们处于分离的bundle中,也会阻止重复. ABP在页面中组织所有bundle并消除重复.
创建贡献者和定义依赖关系是一种跨不同模块组织包创建的方法.
创建贡献者和定义依赖关系是一种跨不同模块组织bundle创建的方法.
#### 贡献者扩展
在某些高级应用场景中, 当用到一个bundle贡献者时你可能想做一些额外的配置. 贡献者扩展可以和被扩展的贡献者无缝衔接.
下面的示例为 prism.js 脚本库添加一些样式:
````csharp
public class MyPrismjsStyleExtension : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("/libs/prismjs/plugins/toolbar/prism-toolbar.css");
}
}
````
然后你可以配置 `BundleContributorOptions` 去扩展已存在的 `PrismjsStyleBundleContributor`.
````csharp
Configure<BundleContributorOptions>(options =>
{
options
.Extensions<PrismjsStyleBundleContributor>()
.Add<MyPrismjsStyleExtension>();
});
````
任何时候当 `PrismjsStyleBundleContributor` 被添加到bundle中时, `MyPrismjsStyleExtension` 也会被自动添加.
#### 访问 IServiceProvider
@ -239,7 +269,7 @@ public class MyExtensionStyleBundleContributor : BundleContributor
将特定的NPM包资源(js,css文件)添加到包中对于该包非常简单. 例如, 你总是为bootstrap NPM包添加`bootstrap.css`文件.
所有[标准NPM包](Client-Side-Package-Management.md)都有内置的贡献者. 例如,如果你的贡献者依赖于引导程序,你可以声明它,而不是自己添加bootstrap.css.
所有[标准NPM包](Client-Side-Package-Management.md)都有内置的贡献者. 例如,如果你的贡献者依赖于bootstrap,你可以声明它,而不是自己添加bootstrap.css.
````C#
[DependsOn(typeof(BootstrapStyleContributor))] //Define the bootstrap style dependency
@ -261,7 +291,7 @@ public class MyExtensionStyleBundleContributor : BundleContributor
> 默认情况下已在启动模板安装此软件包. 大多数情况下,你不需要手动安装它.
标准包贡献者在`Volo.Abp.AspNetCore.Mvc.UI.Packages` NuGet包中定义.
安装到你的项目中:
将它安装到你的项目中:
````
install-package Volo.Abp.AspNetCore.Mvc.UI.Packages
@ -283,9 +313,9 @@ namespace MyCompany.MyProject
}
````
#### Bundle Inheritance
#### Bundle 继承
在某些特定情况下, 可能需要从其他bundle创建一个 **新** bundle **继承**, 从bundle继承(递归)继承该bundle的所有文件/贡献者. 然后派生的bundle可以添加或修改文件/贡献者**而无需修改**原始.
在某些特定情况下, 可能需要从其他bundle创建一个 **新** bundle **继承**, 从bundle继承(递归)继承该bundle的所有文件/贡献者. 然后派生的bundle可以添加或修改文件/贡献者**而无需修改**原始bundle.
例如:
````c#

@ -125,7 +125,6 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form
return GetLabelAsHtmlUsingTagHelper(context, output) + GetRequiredSymbol(context, output);
}
protected virtual string GetRequiredSymbol(TagHelperContext context, TagHelperOutput output)
{
if (!TagHelper.DisplayRequiredSymbol)

@ -1,4 +1,4 @@
# docs module
# Docs Module
This module is used to create technical documentation web sites. [abp.io](https://abp.io) web site uses this module for its documentation.
### Screenshot
@ -7,7 +7,7 @@ This module is used to create technical documentation web sites. [abp.io](https:
### Main Features
* Can read documents from a Github repository.
* Retrieves documents from a Github repository.
* Supports Markdown document formatting.
* Supports versioning (integrated to Github releases).
* Support multiple projects.
* Supports multiple projects.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

@ -36,10 +36,13 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Assets\Images\" />
<Folder Include="Logs\" />
</ItemGroup>
<ItemGroup>
<None Include="wwwroot\assets\images\Logo.png" />
</ItemGroup>
<ItemGroup>
<None Update="run.bat">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

@ -1,5 +1,5 @@
{
"ConnectionString": "Server=localhost;Database=VoloDocs;Trusted_Connection=True;MultipleActiveResultSets=true",
"Title": "Volo Documents",
"LogoUrl": "/Assets/Images/Logo.png"
"LogoUrl": "/assets/images/Logo.png"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

@ -12,6 +12,11 @@
PageLayout.Content.BreadCrumb.Add(L["Menu:IdentityManagement"].Value);
PageLayout.Content.MenuItemName = IdentityMenuNames.Roles;
}
@section styles {
<abp-style-bundle name="@typeof(IndexModel).FullName">
<abp-style src="/Pages/AbpPermissionManagement/permission-management-modal.css" />
</abp-style-bundle>
}
@section scripts {
<abp-script-bundle name="@typeof(IndexModel).FullName">
<abp-script src="/Pages/AbpPermissionManagement/permission-management-modal.js" />

@ -15,6 +15,11 @@
PageLayout.Content.BreadCrumb.Add(L["Menu:IdentityManagement"].Value);
PageLayout.Content.MenuItemName = IdentityMenuNames.Users;
}
@section styles {
<abp-style-bundle name="@typeof(IndexModel).FullName">
<abp-style src="/Pages/AbpPermissionManagement/permission-management-modal.css" />
</abp-style-bundle>
}
@section scripts {
<abp-script-bundle name="@typeof(IndexModel).FullName">
<abp-script src="/Pages/AbpPermissionManagement/permission-management-modal.js" />

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Volo.Abp.IdentityServer
{
public class PersistentGrantRepository_Tests : PersistentGrantRepository_Tests<AbpIdentityServerTestEntityFrameworkCoreModule>
{
}
}

@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Volo.Abp.IdentityServer
{
public class PersistentGrantRepository_Tests : PersistentGrantRepository_Tests<AbpIdentityServerMongoDbTestModule>
{
}
}

@ -1,6 +1,8 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Guids;
using Volo.Abp.Identity;
using Volo.Abp.IdentityServer.ApiResources;
using Volo.Abp.IdentityServer.Clients;
using Volo.Abp.IdentityServer.Grants;
@ -14,7 +16,8 @@ namespace Volo.Abp.IdentityServer
private readonly IApiResourceRepository _apiResourceRepository;
private readonly IClientRepository _clientRepository;
private readonly IIdentityResourceRepository _identityResourceRepository;
//private readonly IPersistentGrantRepository _persistentGrantRepository;
private readonly IIdentityClaimTypeRepository _identityClaimTypeRepository;
private readonly IPersistentGrantRepository _persistentGrantRepository;
private readonly AbpIdentityServerTestData _testData;
public AbpIdentityServerTestDataBuilder(
@ -22,15 +25,17 @@ namespace Volo.Abp.IdentityServer
IApiResourceRepository apiResourceRepository,
IClientRepository clientRepository,
IIdentityResourceRepository identityResourceRepository,
AbpIdentityServerTestData testData
/*IPersistentGrantRepository persistentGrantRepository*/)
IIdentityClaimTypeRepository identityClaimTypeRepository,
AbpIdentityServerTestData testData,
IPersistentGrantRepository persistentGrantRepository)
{
_testData = testData;
_guidGenerator = guidGenerator;
_apiResourceRepository = apiResourceRepository;
_clientRepository = clientRepository;
_identityResourceRepository = identityResourceRepository;
//_persistentGrantRepository = persistentGrantRepository;
_identityClaimTypeRepository = identityClaimTypeRepository;
_persistentGrantRepository = persistentGrantRepository;
}
public void Build()
@ -39,13 +44,30 @@ namespace Volo.Abp.IdentityServer
AddIdentityResources();
AddApiResources();
AddClients();
AddClaimTypes();
}
private void AddPersistedGrants()
{
//_persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create()));
//_persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create()));
//_persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create()));
_persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create())
{
Key = "PersistedGrantKey1",
SubjectId = "PersistedGrantSubjectId1",
ClientId = "PersistedGrantClientId1",
Type = "PersistedGrantType1"
});
_persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create())
{
Key = "PersistedGrantKey2",
SubjectId = "PersistedGrantSubjectId2"
});
_persistentGrantRepository.Insert(new PersistedGrant(_guidGenerator.Create())
{
Key = "PersistedGrantKey3",
SubjectId = "PersistedGrantSubjectId3"
});
}
private void AddIdentityResources()
@ -105,5 +127,12 @@ namespace Volo.Abp.IdentityServer
_clientRepository.Insert(new Client(_guidGenerator.Create(), "ClientId2"));
_clientRepository.Insert(new Client(_guidGenerator.Create(), "ClientId3"));
}
private void AddClaimTypes()
{
var ageClaim = new IdentityClaimType(Guid.NewGuid(), "Age", false, false, null, null, null,
IdentityClaimValueType.Int);
_identityClaimTypeRepository.Insert(ageClaim);
}
}
}

@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Shouldly;
using Volo.Abp.IdentityServer.Grants;
using Volo.Abp.Modularity;
using Xunit;
namespace Volo.Abp.IdentityServer
{
public abstract class PersistentGrantRepository_Tests<TStartupModule> : AbpIdentityServerTestBase<TStartupModule>
where TStartupModule : IAbpModule
{
private readonly IPersistentGrantRepository _persistentGrantRepository;
protected PersistentGrantRepository_Tests()
{
_persistentGrantRepository = GetRequiredService<IPersistentGrantRepository>();
}
[Fact]
public async Task FindByKeyAsync()
{
(await _persistentGrantRepository.FindByKeyAsync("PersistedGrantKey1")).ShouldNotBeNull();
}
[Fact]
public async Task GetListBySubjectIdAsync()
{
var persistedGrants = await _persistentGrantRepository.GetListBySubjectIdAsync("PersistedGrantSubjectId1");
persistedGrants.ShouldNotBeEmpty();
persistedGrants.ShouldContain(x => x.Key == "PersistedGrantKey1");
}
[Fact]
public async Task DeleteBySubjectIdAndClientId()
{
await _persistentGrantRepository.DeleteAsync("PersistedGrantSubjectId1", "PersistedGrantClientId1");
var persistedGrants = await _persistentGrantRepository.GetListAsync();
persistedGrants.ShouldNotBeEmpty();
persistedGrants.ShouldNotContain(x =>
x.Key == "PersistedGrantKey1" && x.SubjectId == "PersistedGrantSubjectId1" &&
x.ClientId == "PersistedGrantClientId1");
}
[Fact]
public async Task DeleteBySubjectIdAndClientIdAndType()
{
await _persistentGrantRepository.DeleteAsync("PersistedGrantSubjectId1", "PersistedGrantClientId1",
"PersistedGrantClientId1");
var persistedGrants = await _persistentGrantRepository.GetListAsync();
persistedGrants.ShouldNotBeEmpty();
persistedGrants.ShouldNotContain(x =>
x.Key == "PersistedGrantKey1" && x.SubjectId == "PersistedGrantSubjectId1" &&
x.ClientId == "PersistedGrantClientId1" && x.Type == "PersistedGrantClientId1");
}
}
}

@ -1,4 +1,5 @@
using AutoMapper;
using Volo.Abp.AutoMapper;
using Volo.Abp.PermissionManagement.Web.Pages.AbpPermissionManagement;
namespace Volo.Abp.PermissionManagement.Web
@ -7,7 +8,7 @@ namespace Volo.Abp.PermissionManagement.Web
{
public AbpPermissionManagementWebAutoMapperProfile()
{
CreateMap<PermissionGroupDto, PermissionManagementModal.PermissionGroupViewModel>();
CreateMap<PermissionGroupDto, PermissionManagementModal.PermissionGroupViewModel>().Ignore(p=>p.IsAllPermissionsGranted);
CreateMap<PermissionGrantInfoDto, PermissionManagementModal.PermissionGrantInfoViewModel>()
.ForMember(p => p.Depth, opts => opts.Ignore());

@ -3,6 +3,8 @@
"texts": {
"Permissions": "Permissions",
"OnlyProviderPermissons": "Only this provider",
"All": "All"
"All": "All",
"SelectAllInAllTabs": "Grant all permissions",
"SelectAllInThisTab": "Select all"
}
}

@ -3,6 +3,8 @@
"texts": {
"Permissions": "İzinler",
"OnlyProviderPermissons": "Sadece bu sağlayıcı",
"All": "Hepsi"
"All": "Hepsi",
"SelectAllInAllTabs": "Tüm izinleri ver",
"SelectAllInThisTab": "Hepsini seç"
}
}

@ -9,44 +9,27 @@
Layout = null;
}
@*TO DO : Following styles and scripts will move*@
<style>
.custom-scroll-container > .col-4 {
overflow: hidden;
overflow-y: auto;
max-height: 499px;
display: block;
position: relative;
z-index: 123;
}
.custom-scroll-content {
max-height: 440px;
}
</style>
<script>
$(function () {
$(".custom-scroll-content").mCustomScrollbar({
theme: "minimal-dark"
});
$(".custom-scroll-container > .col-4").mCustomScrollbar({
theme: "minimal-dark"
});
});
</script>
<form method="post" asp-page="/AbpPermissionManagement/PermissionManagementModal" data-script-class="abp.modals.PermissionManagement">
<abp-modal size="Large">
<abp-modal-header title="@(L["Permissions"].Value) - @Model.EntityDisplayName"></abp-modal-header>
<abp-modal-body class="custom-scroll-container">
<input asp-for="@Model.ProviderKey" />
<input asp-for="@Model.ProviderName" />
<abp-input asp-for="SelectAllInAllTabs" label="@L["SelectAllInAllTabs"].Value"/>
<hr class="mt-2 mb-2"/>
<input asp-for="@Model.ProviderKey"/>
<input asp-for="@Model.ProviderName"/>
<abp-tabs name="PermissionsTabs" tab-style="PillVertical" vertical-header-size="_4" class="custom-scroll-container">
@for (var i = 0; i < Model.Groups.Count; i++)
{
<abp-tab title="@Model.Groups[i].DisplayName" name="v-pills-tab-@Model.Groups[i].GetNormalizedGroupName()">
<h4>@Model.Groups[i].DisplayName</h4>
<hr class="mt-3 mb-3" />
<hr class="mt-2 mb-3"/>
<div class="custom-scroll-content">
<div class="pl-1 pt-1">
<abp-input asp-for="@Model.Groups[i].IsAllPermissionsGranted" name="SelectAllInThisTab"
id="SelectAllInThisTab-@Model.Groups[i].GetNormalizedGroupName()"
data-tab-id="v-pills-tab-@Model.Groups[i].GetNormalizedGroupName()"
label="@L["SelectAllInThisTab"].Value"/>
<hr class="mb-3"/>
@for (var j = 0; j < Model.Groups[i].Permissions.Count; j++)
{
<abp-input asp-for="@Model.Groups[i].Permissions[j].IsGranted"
@ -54,8 +37,8 @@
disabled="@Model.Groups[i].Permissions[j].IsDisabled(Model.ProviderName)"
group-data-permission-name="@Model.Groups[i].Permissions[j].Name"
group-data-parent-name="@(Model.Groups[i].Permissions[j].ParentName ?? "")"
group-style="margin-left: @(Model.Groups[i].Permissions[j].Depth * 20)px" />
<input asp-for="@Model.Groups[i].Permissions[j].Name" />
group-style="margin-left: @(Model.Groups[i].Permissions[j].Depth * 20)px"/>
<input asp-for="@Model.Groups[i].Permissions[j].Name"/>
}
</div>
</div>

@ -25,6 +25,10 @@ namespace Volo.Abp.PermissionManagement.Web.Pages.AbpPermissionManagement
public string EntityDisplayName { get; set; }
public bool SelectAllInThisTab { get; set; }
public bool SelectAllInAllTabs { get; set; }
private readonly IPermissionAppService _permissionAppService;
public PermissionManagementModal(IPermissionAppService permissionAppService)
@ -49,6 +53,13 @@ namespace Volo.Abp.PermissionManagement.Web.Pages.AbpPermissionManagement
{
new FlatTreeDepthFinder<PermissionGrantInfoViewModel>().SetDepths(group.Permissions);
}
foreach (var group in Groups)
{
group.IsAllPermissionsGranted = group.Permissions.All(p => p.IsGranted);
}
SelectAllInAllTabs = Groups.All(g => g.IsAllPermissionsGranted);
}
public async Task<IActionResult> OnPostAsync()
@ -80,6 +91,8 @@ namespace Volo.Abp.PermissionManagement.Web.Pages.AbpPermissionManagement
{
public string Name { get; set; }
public bool IsAllPermissionsGranted { get; set; }
public string DisplayName { get; set; }
public List<PermissionGrantInfoViewModel> Permissions { get; set; }

@ -0,0 +1,12 @@
.custom-scroll-container > .col-4 {
overflow: hidden;
overflow-y: auto;
max-height: 499px;
display: block;
position: relative;
z-index: 123;
}
.custom-scroll-content {
max-height: 440px;
}

@ -12,7 +12,7 @@
$tab.find('.custom-checkbox')
.filter('[data-permission-name="' + parentName + '"]')
.find('input[type="checkbox"]')
.each(function() {
.each(function () {
var $parent = $(this);
$parent.prop('checked', true);
checkParents($tab, $parent);
@ -35,20 +35,170 @@
});
}
this.initDom = function($el) {
function handleUncheck($tab) {
var $checkBox = $tab.find('input[name="SelectAllInThisTab"]');
if ($checkBox.is(':checked')) {
if ($tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]').length > 1) {
$($checkBox).prop('indeterminate', true);
}
else {
$checkBox.prop('checked', false);
}
}
else if ($checkBox.is(':indeterminate')) {
var allUnchecked = true;
$tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]').each(function () {
if ($(this).is(':checked') === true) {
allUnchecked = false;
}
});
if (allUnchecked) {
$($checkBox).prop('indeterminate', false);
$checkBox.prop('checked', false);
}
}
}
function handleCheck($tab) {
var $checkBox = $tab.find('input[name="SelectAllInThisTab"]');
var allChecked = true;
$tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]').each(function () {
if ($(this).is(':checked') === false) {
allChecked = false;
}
});
if (allChecked) {
$($checkBox).prop('indeterminate', false);
$checkBox.prop('checked', true);
}
else {
$($checkBox).prop('indeterminate', true);
}
}
function initSelectAllInThisTab() {
var tabs = $('.tab-pane');
for (var i = 0; i < tabs.length; i++) {
var $tab = $(tabs[i]);
var $checkBox = $tab.find('input[name="SelectAllInThisTab"]');
var allChecked = true;
var allUnChecked = true;
$tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]').each(function () {
if ($(this).is(':checked') === true) {
allUnChecked = false;
} else {
allChecked = false;
}
});
if (allChecked) {
$($checkBox).prop('checked', true);
}
else if (allUnChecked) {
$($checkBox).prop('checked', false);
}
else {
$($checkBox).prop('indeterminate', true);
}
}
}
function setSelectAllInAllTabs() {
var $checkBox = $('#SelectAllInAllTabs');
var anyIndeterminate = false;
var allChecked = true;
var allUnChecked = true;
$('input[name="SelectAllInThisTab"]').each(function () {
if ($(this).is(':checked') === true) {
allUnChecked = false;
} else {
allChecked = false;
}
if ($(this).is(':indeterminate') === true) {
anyIndeterminate = true;
}
});
if (anyIndeterminate) {
$($checkBox).prop('indeterminate', true);
return;
} else {
$($checkBox).prop('indeterminate', false);
}
if (allChecked) {
$($checkBox).prop('checked', true);
}
else if (allUnChecked) {
$($checkBox).prop('checked', false);
}
else {
$($checkBox).prop('indeterminate', true);
}
}
this.initDom = function ($el) {
$el.find('.tab-pane').each(function () {
var $tab = $(this);
$tab.find('input[type="checkbox"]').each(function () {
$tab.find('input[type="checkbox"]').not('[name="SelectAllInThisTab"]').each(function () {
var $checkBox = $(this);
$checkBox.change(function () {
if ($checkBox.is(':checked')) {
checkParents($tab, $checkBox);
handleCheck($tab);
} else {
uncheckChildren($tab, $checkBox);
handleUncheck($tab);
}
setSelectAllInAllTabs();
});
});
});
$('input[name="SelectAllInThisTab"]').change(function () {
var $checkBox = $(this);
var $tab = $('#' + $checkBox.attr('data-tab-id'));
if ($checkBox.is(':checked')) {
$tab.find('input[type="checkbox"]').prop('checked', true);
} else {
$tab.find('input[type="checkbox"]').prop('checked', false);
}
$($checkBox).prop('indeterminate', false);
setSelectAllInAllTabs();
});
$('input[name="SelectAllInAllTabs"]').change(function () {
var $checkBox = $(this);
if ($checkBox.is(':checked')) {
$('.tab-pane input[type="checkbox"]').prop('checked', true);
} else {
$('.tab-pane input[type="checkbox"]').prop('checked', false);
}
$($checkBox).prop('indeterminate', false);
});
$(function () {
$(".custom-scroll-content").mCustomScrollbar({
theme: "minimal-dark"
});
$(".custom-scroll-container > .col-4").mCustomScrollbar({
theme: "minimal-dark"
});
});
initSelectAllInThisTab();
setSelectAllInAllTabs();
};
};
})(jQuery);
Loading…
Cancel
Save