Add flag icon on client profile

This commit is contained in:
RaidMax
2019-08-04 17:06:07 -05:00
parent bb42861a92
commit 75378400e7
14 changed files with 143 additions and 30 deletions

View File

@ -42,6 +42,7 @@ $(document).ready(function () {
$('#actionModal').trigger('action_form_received', actionType);
})
.fail(function (jqxhr, textStatus, error) {
$('#actionModal .modal-body-content').html('');
$('#actionModal .modal-message').text('Error — ' + error);
$('#actionModal').modal();
$('#actionModal .modal-message').fadeIn('fast');
@ -54,6 +55,7 @@ $(document).ready(function () {
$(document).on('submit', '.action-form', function (e) {
e.preventDefault();
$(this).append($('#target_id input'));
$('#actionModal').data('should-refresh', $('#actionModal').find('.refreshable').length !== 0);
const data = $(this).serialize();
showLoader();
$.get($(this).attr('action') + '/?' + data)
@ -102,4 +104,15 @@ $(document).ready(function () {
});
}
});
/*
* handle close event to refresh if need be
*/
$("#actionModal").on("hidden.bs.modal", function () {
let shouldRefresh = $(this).data('should-refresh');
if (shouldRefresh !== undefined && shouldRefresh) {
location.reload();
}
});
});

View File

@ -41,9 +41,19 @@ function loadMoreItems() {
loaderOffset += loadCount;
}
var hasScrollBar = false;
function _ScrollHandler(e) {
//throttle event:
/*
https://stackoverflow.com/questions/3898130/check-if-a-user-has-scrolled-to-the-bottom
*/
var $window = $(window);
var $document = $(document);
hasScrollBar = true;
let _throttleTimer = null;
let _throttleDelay = 100;
clearTimeout(_throttleTimer);
_throttleTimer = setTimeout(function () {
@ -69,18 +79,10 @@ function setupListeners() {
}
});
/*
https://stackoverflow.com/questions/3898130/check-if-a-user-has-scrolled-to-the-bottom
*/
var _throttleTimer = null;
var _throttleDelay = 100;
var $window = $(window);
var $document = $(document);
var hasScrollBar = false;
$document.ready(function () {
$window
$(document).ready(function () {
$(window)
.off('scroll', _ScrollHandler)
.on('scroll', _ScrollHandler);
$('.loader-load-more:not(.disabled)').click(function (e) {

View File

@ -80,7 +80,7 @@ function refreshClientActivity() {
cache: false
})
.done(function (response) {
const clientCount = $(response).find('.col-6 span').length;
const clientCount = $(response).find('a').length;
$('#server_header_' + serverId + ' .server-clientcount').text(clientCount);
$('#server_clientactivity_' + serverId).html(response);
})

View File

@ -20,7 +20,7 @@
if (interval < 1)
interval = 1;
let primaryColor = window.getComputedStyle(document.body).getPropertyValue('--primary').trim();
//let primaryColor = $('.nav-tabs .nav-link.active').first().css('background-color')
return new CanvasJS.Chart(id, {
backgroundColor: 'transparent',
@ -56,10 +56,11 @@
dockInsidePlotArea: true
},
data: [{
type: 'splineArea',
color: primaryColor.endsWith('80') ? primaryColor : primaryColor + '40',
markerSize: 3.5,
dataPoints: fixedData
type: 'spline',
color: '#c0c0c0',
markerSize: 0,
dataPoints: fixedData,
lineThickness: 2
}]
});
}