|
|
|
@ -1,5 +1,7 @@ |
|
|
|
(function () { |
|
|
|
abp.widgets.MembersArea = function ($wrapper) { |
|
|
|
var widgetManager = $wrapper.data('abp-widget-manager'); |
|
|
|
|
|
|
|
var organizationId = $wrapper.find('[data-organization-id]').attr('data-organization-id'); |
|
|
|
var totalCount = Number($wrapper.find('[data-total-count]').attr('data-total-count')) |
|
|
|
var skipCount = Number($wrapper.find('[data-skip-count]').attr('data-skip-count')) |
|
|
|
@ -9,7 +11,16 @@ |
|
|
|
var hashCode = Number($wrapper.find('[data-hash-code]').attr('data-hash-code')) |
|
|
|
skipCount += maxResultCount; |
|
|
|
|
|
|
|
function moreDetailFilter() { |
|
|
|
function getFilters() { |
|
|
|
return { |
|
|
|
organizationId: organizationId, |
|
|
|
maxResultCount: maxResultCount, |
|
|
|
isPagination: isPagination, |
|
|
|
isMoreDetail: isMoreDetail |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
function manipulateDOMForMoreDetail() { |
|
|
|
var hashCode = Number($wrapper.find('[data-hash-code]').attr('data-hash-code')) |
|
|
|
$('#MemberList-' + hashCode + '> div').addClass('col-6 col-md-4 col-lg-2'); |
|
|
|
$('#MemberList-' + hashCode + '> * > div > .member-name').removeAttr('style'); |
|
|
|
@ -17,8 +28,8 @@ |
|
|
|
$('#load-more-section-' + hashCode).addClass('text-center mt-3'); |
|
|
|
} |
|
|
|
|
|
|
|
if (isMoreDetail === 'True'){ |
|
|
|
moreDetailFilter() |
|
|
|
if (isMoreDetail === 'True') { |
|
|
|
manipulateDOMForMoreDetail() |
|
|
|
} |
|
|
|
|
|
|
|
function init() { |
|
|
|
@ -36,8 +47,8 @@ |
|
|
|
memberList.append(response); |
|
|
|
skipCount += maxResultCount; |
|
|
|
}).always(function () { |
|
|
|
if (isMoreDetail === 'True'){ |
|
|
|
moreDetailFilter() |
|
|
|
if (isMoreDetail === 'True') { |
|
|
|
manipulateDOMForMoreDetail() |
|
|
|
} |
|
|
|
if (skipCount >= totalCount) { |
|
|
|
loadMoreButton.hide(); |
|
|
|
@ -46,24 +57,18 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
abp.event.on("EventHub.Organization.JoinStatusChanged", function () { |
|
|
|
var memberAreaWidgets = document.querySelectorAll('[data-widget-name="MembersArea"]') |
|
|
|
memberAreaWidgets.forEach(function(entry) { |
|
|
|
$(entry).data('abp-widget-manager') |
|
|
|
.refresh(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
return { |
|
|
|
getFilters: function () { |
|
|
|
return { |
|
|
|
organizationId: organizationId, |
|
|
|
skipCount: skipCount, |
|
|
|
maxResultCount: maxResultCount, |
|
|
|
isPagination: isPagination, |
|
|
|
isMoreDetail: isMoreDetail |
|
|
|
}; |
|
|
|
}, |
|
|
|
getFilters: getFilters, |
|
|
|
init: init |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
abp.event.on("EventHub.Organization.JoinStatusChanged", function () { |
|
|
|
$('[data-widget-name="MembersArea"]') |
|
|
|
.data('abp-widget-manager') |
|
|
|
.refresh(); |
|
|
|
}); |
|
|
|
})(); |
|
|
|
|