|
|
|
@ -2,9 +2,24 @@ var abp = abp || {}; |
|
|
|
(function ($) { |
|
|
|
abp.modals = abp.modals || {}; |
|
|
|
|
|
|
|
let l = abp.localization.getResource("FeatureManagement"); |
|
|
|
|
|
|
|
|
|
|
|
abp.modals.FeatureManagement = function () { |
|
|
|
abp.ResourceLoader.loadScript('/client-proxies/featureManagement-proxy.js'); |
|
|
|
$('#ResetToDefaults').click(function (e) { |
|
|
|
abp.message.confirm('Are you sure to reset to defaults?') |
|
|
|
.then(function (confirmed) { |
|
|
|
if (confirmed) { |
|
|
|
volo.abp.featureManagement.features.resetToDefault().then(function () { |
|
|
|
abp.notify.success(l('Reseted')); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
function checkParents($tab, $element, className) { |
|
|
|
var parentName = $element |
|
|
|
let parentName = $element |
|
|
|
.closest(className) |
|
|
|
.attr('data-parent-name'); |
|
|
|
|
|
|
|
@ -16,14 +31,14 @@ var abp = abp || {}; |
|
|
|
.filter('[data-feature-name="' + parentName + '"]') |
|
|
|
.find('input[type="checkbox"]') |
|
|
|
.each(function () { |
|
|
|
var $parent = $(this); |
|
|
|
let $parent = $(this); |
|
|
|
$parent.prop('checked', true); |
|
|
|
checkParents($tab, $parent, className); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
function uncheckChildren($tab, $checkBox) { |
|
|
|
var featureName = $checkBox |
|
|
|
let featureName = $checkBox |
|
|
|
.closest('.custom-checkbox') |
|
|
|
.attr('data-feature-name'); |
|
|
|
if (!featureName) { |
|
|
|
@ -34,7 +49,7 @@ var abp = abp || {}; |
|
|
|
.filter('[data-parent-name="' + featureName + '"]') |
|
|
|
.find('input[type="checkbox"]') |
|
|
|
.each(function () { |
|
|
|
var $child = $(this); |
|
|
|
let $child = $(this); |
|
|
|
$child.prop('checked', false); |
|
|
|
uncheckChildren($tab, $child); |
|
|
|
}); |
|
|
|
@ -42,10 +57,10 @@ var abp = abp || {}; |
|
|
|
|
|
|
|
this.initDom = function ($el) { |
|
|
|
$el.find('.tab-pane').each(function () { |
|
|
|
var $tab = $(this); |
|
|
|
let $tab = $(this); |
|
|
|
$tab.find('input[type="checkbox"]') |
|
|
|
.each(function () { |
|
|
|
var $checkBox = $(this); |
|
|
|
let $checkBox = $(this); |
|
|
|
$checkBox.change(function () { |
|
|
|
if ($checkBox.is(':checked')) { |
|
|
|
checkParents($tab, $checkBox, '.custom-checkbox') |
|
|
|
@ -57,7 +72,7 @@ var abp = abp || {}; |
|
|
|
|
|
|
|
$tab.find('.form-control') |
|
|
|
.each(function () { |
|
|
|
var $element = $(this); |
|
|
|
let $element = $(this); |
|
|
|
$element.change(function () { |
|
|
|
checkParents($tab, $element, '.form-group') |
|
|
|
}); |
|
|
|
|