Browse Source

implemented razor UI

pull/14514/head
malik masis 4 years ago
parent
commit
3d1ede910e
  1. 6
      modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml
  2. 29
      modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js

6
modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/FeatureManagementModal.cshtml

@ -119,7 +119,11 @@
</abp-tabs>
</abp-modal-body>
<abp-modal-footer buttons="@(AbpModalButtons.Cancel | AbpModalButtons.Save)"></abp-modal-footer>
<abp-modal-footer>
<abp-button button-type="Primary" id="ResetToDefaults"><i class="fa fa-refresh"></i> @L["ResetToDefaults"]</abp-button>
<abp-button data-bs-dismiss="modal" button-type="Secondary">@L["Cancel"]</abp-button>
<abp-button button-type="Primary" type="submit"><i class="fa fa-check"></i> @L["Save"]</abp-button>
</abp-modal-footer>
}
else
{

29
modules/feature-management/src/Volo.Abp.FeatureManagement.Web/Pages/FeatureManagement/feature-management-modal.js

@ -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')
});

Loading…
Cancel
Save