Merge branch 'dev' of bitbucket.org:jubilian/nhance into dev
This commit is contained in:
commit
f20a184f77
@ -111,7 +111,7 @@ class EmployeeController extends AdminController
|
|||||||
emp_name : $filterData['emp_name'] ?? null,
|
emp_name : $filterData['emp_name'] ?? null,
|
||||||
status : $filterData['status'] ?? [],
|
status : $filterData['status'] ?? [],
|
||||||
);
|
);
|
||||||
log_message('error',json_encode($data['employees']));
|
// log_message('error',json_encode($data['employees']));
|
||||||
// Set getData in $data array with the processed $filterData
|
// Set getData in $data array with the processed $filterData
|
||||||
$data['getData'] = $filterData;
|
$data['getData'] = $filterData;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -135,8 +135,8 @@ class LeadsController extends BaseController
|
|||||||
// dd($data);
|
// dd($data);
|
||||||
|
|
||||||
// Fetch leads data
|
// Fetch leads data
|
||||||
$data['lead_data_list'] = $this->leadsModel->getLeadDataForLising();
|
$data ['lead_data_list'] = $this->leadsModel->getLeadDataForLising();
|
||||||
|
|
||||||
// Load layout and pass data
|
// Load layout and pass data
|
||||||
$this->loadLayout('leads_list', $data);
|
$this->loadLayout('leads_list', $data);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,32 @@ table.dataTable tbody td {
|
|||||||
.dataTables_filter {
|
.dataTables_filter {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
.custom-dropdown-menu {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
background-color: #ffffff !important;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
min-width: 10rem;
|
||||||
|
z-index: 9999;
|
||||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item {
|
||||||
|
display: block !important;
|
||||||
|
width: 100% !important;
|
||||||
|
padding: 0.5rem 1rem !important;
|
||||||
|
color: #212529 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item:hover {
|
||||||
|
background-color: #f8f9fa !important;
|
||||||
|
color: #16181b !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -210,27 +236,96 @@ table.dataTable tbody td {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
// Get all rows of the table
|
const table = document.getElementById("scroll-horizontal-datatable");
|
||||||
const rows = document.querySelectorAll('#scroll-horizontal-datatable tbody tr');
|
|
||||||
|
|
||||||
rows.forEach(row => {
|
// Create custom dropdown
|
||||||
// Add a click event listener to each row
|
function createCustomDropdown(row) {
|
||||||
row.addEventListener('click', function(event) {
|
// Get the original dropdown items
|
||||||
// Find the dropdown toggle button inside the clicked row
|
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||||
const dropdownToggle = row.querySelector('.dropdown-toggle');
|
if (!originalDropdown) return null;
|
||||||
|
|
||||||
|
// Create new dropdown with proper background and spacing
|
||||||
|
const customDropdown = document.createElement('div');
|
||||||
|
customDropdown.className = 'custom-dropdown-menu';
|
||||||
|
|
||||||
|
// Copy inner content while maintaining icon alignment
|
||||||
|
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||||
|
|
||||||
|
return customDropdown;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if the clicked element is not the dropdown button itself to avoid unnecessary clicks
|
let activeDropdown = null;
|
||||||
if (dropdownToggle && !event.target.closest('.dropdown-menu')) {
|
|
||||||
// Manually trigger Bootstrap's dropdown toggle using Bootstrap's Dropdown class
|
// Add click event listener to rows
|
||||||
const dropdown = new bootstrap.Dropdown(dropdownToggle);
|
table.querySelectorAll("tbody tr").forEach(row => {
|
||||||
dropdown.toggle(); // Toggle the dropdown visibility
|
const customDropdown = createCustomDropdown(row);
|
||||||
|
if (!customDropdown) return;
|
||||||
|
|
||||||
|
// Append the custom dropdown to the body
|
||||||
|
document.body.appendChild(customDropdown);
|
||||||
|
|
||||||
|
row.addEventListener("click", function(event) {
|
||||||
|
// Ignore clicks on the action column
|
||||||
|
if (event.target.closest('td:last-child')) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hide any active dropdown
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get click position
|
||||||
|
const rect = event.target.getBoundingClientRect();
|
||||||
|
|
||||||
|
// Position the dropdown with some offset
|
||||||
|
customDropdown.style.display = 'block';
|
||||||
|
customDropdown.style.position = 'fixed';
|
||||||
|
customDropdown.style.left = `${rect.left}px`;
|
||||||
|
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||||
|
|
||||||
|
// Set as active dropdown
|
||||||
|
activeDropdown = customDropdown;
|
||||||
|
|
||||||
|
event.stopPropagation();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Preserve click handlers and add auto-close
|
||||||
|
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||||
|
item.addEventListener('click', function(e) {
|
||||||
|
const onclickAttr = this.getAttribute('onclick');
|
||||||
|
if (onclickAttr) {
|
||||||
|
eval(onclickAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
const href = this.getAttribute('href');
|
||||||
|
if (href && href !== '#') {
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close the dropdown after handling the click
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Close dropdown when clicking outside
|
||||||
|
document.addEventListener("click", function() {
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Datatable document ready
|
// Datatable document ready
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|||||||
@ -16,11 +16,32 @@ table.dataTable thead th {
|
|||||||
|
|
||||||
max-width: 98% !important;
|
max-width: 98% !important;
|
||||||
}
|
}
|
||||||
.dropdown-menu {
|
.custom-dropdown-menu {
|
||||||
position: absolute !important;
|
display: none;
|
||||||
z-index: 1050 !important; /* Ensures dropdown appears above other elements */
|
position: absolute;
|
||||||
transform: none !important; /* Prevents Bootstrap's default offset positioning */
|
background-color: #ffffff !important;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
min-width: 10rem;
|
||||||
|
z-index: 9999;
|
||||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item {
|
||||||
|
display: block !important;
|
||||||
|
width: 100% !important;
|
||||||
|
padding: 0.5rem 1rem !important;
|
||||||
|
color: #212529 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item:hover {
|
||||||
|
background-color: #f8f9fa !important;
|
||||||
|
color: #16181b !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="row" id="client_list">
|
<div class="row" id="client_list">
|
||||||
@ -164,40 +185,100 @@ table.dataTable thead th {
|
|||||||
</div>
|
</div>
|
||||||
</div><!-- /.modal -->
|
</div><!-- /.modal -->
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
const table = document.getElementById("tickets-table");
|
const table = document.getElementById("tickets-table");
|
||||||
|
|
||||||
|
// Create custom dropdown
|
||||||
|
function createCustomDropdown(row) {
|
||||||
|
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||||
|
if (!originalDropdown) return null;
|
||||||
|
|
||||||
|
const customDropdown = document.createElement('div');
|
||||||
|
customDropdown.className = 'custom-dropdown-menu';
|
||||||
|
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||||
|
|
||||||
|
return customDropdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
let activeDropdown = null;
|
||||||
|
|
||||||
// Add click event listener to rows
|
// Add click event listener to rows
|
||||||
table.querySelectorAll("tbody tr").forEach(row => {
|
table.querySelectorAll("tbody tr").forEach(row => {
|
||||||
row.addEventListener("click", function (event) {
|
const customDropdown = createCustomDropdown(row);
|
||||||
// Check if the clicked element is inside the dropdown
|
if (!customDropdown) return;
|
||||||
if (event.target.closest(".dropdown-toggle") || event.target.closest(".dropdown-menu")) {
|
|
||||||
return; // Do nothing if the dropdown or its menu is clicked
|
row.customDropdown = customDropdown;
|
||||||
|
document.body.appendChild(customDropdown);
|
||||||
|
|
||||||
|
row.addEventListener("click", function(event) {
|
||||||
|
// Ignore clicks on the last column (action column)
|
||||||
|
if (event.target.closest('td') === row.lastElementChild) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trigger dropdown menu programmatically
|
// Hide any active dropdown
|
||||||
const dropdownToggle = this.querySelector(".dropdown-toggle");
|
if (activeDropdown && activeDropdown !== customDropdown) {
|
||||||
if (dropdownToggle) {
|
activeDropdown.style.display = 'none';
|
||||||
const dropdown = new bootstrap.Dropdown(dropdownToggle); // Bootstrap instance
|
|
||||||
dropdown.toggle(); // Toggle dropdown visibility
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Toggle the dropdown display
|
||||||
|
const isActive = customDropdown.style.display === 'block';
|
||||||
|
customDropdown.style.display = isActive ? 'none' : 'block';
|
||||||
|
|
||||||
|
// Set the position of the dropdown
|
||||||
|
const rect = event.target.closest('td').getBoundingClientRect();
|
||||||
|
customDropdown.style.position = 'absolute';
|
||||||
|
customDropdown.style.left = `${rect.left}px`;
|
||||||
|
customDropdown.style.top = `${rect.bottom + 5}px`;
|
||||||
|
|
||||||
|
// Set as active dropdown
|
||||||
|
activeDropdown = isActive ? null : customDropdown;
|
||||||
|
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Preserve click handlers for modal actions
|
||||||
|
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||||
|
item.addEventListener('click', function(e) {
|
||||||
|
const isModalAction = this.hasAttribute('data-toggle') && this.getAttribute('data-toggle') === 'modal';
|
||||||
|
if (isModalAction) {
|
||||||
|
return; // Allow modal to function normally
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close the dropdown if it's not related to modal
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const onclickAttr = this.getAttribute('onclick');
|
||||||
|
if (onclickAttr) {
|
||||||
|
eval(onclickAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
const href = this.getAttribute('href');
|
||||||
|
if (href && href !== '#') {
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Close dropdowns when clicking outside the table
|
// Close dropdown when clicking outside
|
||||||
document.addEventListener("click", function (event) {
|
document.addEventListener("click", function() {
|
||||||
if (!event.target.closest("#tickets-table")) {
|
if (activeDropdown) {
|
||||||
const openDropdowns = document.querySelectorAll(".dropdown-menu.show");
|
activeDropdown.style.display = 'none';
|
||||||
openDropdowns.forEach(menu => {
|
activeDropdown = null;
|
||||||
menu.classList.remove("show");
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|||||||
@ -16,6 +16,33 @@ table.dataTable thead th {
|
|||||||
|
|
||||||
max-width: 98% !important;
|
max-width: 98% !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
background-color: #ffffff !important;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
min-width: 10rem;
|
||||||
|
z-index: 9999;
|
||||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item {
|
||||||
|
display: block !important;
|
||||||
|
width: 100% !important;
|
||||||
|
padding: 0.5rem 1rem !important;
|
||||||
|
color: #212529 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item:hover {
|
||||||
|
background-color: #f8f9fa !important;
|
||||||
|
color: #16181b !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="row" id="client_list">
|
<div class="row" id="client_list">
|
||||||
@ -114,6 +141,123 @@ table.dataTable thead th {
|
|||||||
</div>
|
</div>
|
||||||
</div><!-- /.modal -->
|
</div><!-- /.modal -->
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const table = document.getElementById("tickets-table");
|
||||||
|
|
||||||
|
// Create custom dropdown
|
||||||
|
function createCustomDropdown(row) {
|
||||||
|
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||||
|
if (!originalDropdown) return null;
|
||||||
|
|
||||||
|
const customDropdown = document.createElement('div');
|
||||||
|
customDropdown.className = 'custom-dropdown-menu';
|
||||||
|
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||||
|
|
||||||
|
// Add 'Open Client Details' option in the dropdown
|
||||||
|
const clientId = row.querySelector('.client_info').dataset.id;
|
||||||
|
const openDetailsOption = document.createElement('a');
|
||||||
|
openDetailsOption.href = "javascript:void(0);";
|
||||||
|
openDetailsOption.className = 'dropdown-item';
|
||||||
|
openDetailsOption.innerHTML = `<i class="mdi mdi-eye mr-2 text-muted font-18 vertical-middle"></i>Open Client Details`;
|
||||||
|
|
||||||
|
openDetailsOption.addEventListener('click', function() {
|
||||||
|
openClientDetailsPage(clientId); // Open the client details page when clicked
|
||||||
|
});
|
||||||
|
|
||||||
|
customDropdown.appendChild(openDetailsOption);
|
||||||
|
|
||||||
|
return customDropdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
let activeDropdown = null;
|
||||||
|
|
||||||
|
// Add click event listener to rows
|
||||||
|
table.querySelectorAll("tbody tr").forEach(row => {
|
||||||
|
const customDropdown = createCustomDropdown(row);
|
||||||
|
if (!customDropdown) return;
|
||||||
|
|
||||||
|
document.body.appendChild(customDropdown);
|
||||||
|
|
||||||
|
row.addEventListener("click", function(event) {
|
||||||
|
// Ignore clicks on the action column
|
||||||
|
if (event.target.closest('td:last-child')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show the action dropdown
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
const rect = event.target.getBoundingClientRect();
|
||||||
|
customDropdown.style.display = 'block';
|
||||||
|
customDropdown.style.position = 'fixed';
|
||||||
|
customDropdown.style.left = `${rect.left}px`;
|
||||||
|
customDropdown.style.top = `${rect.bottom + 5}px`; // 5px gap
|
||||||
|
|
||||||
|
activeDropdown = customDropdown;
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
|
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||||
|
item.addEventListener('click', function(e) {
|
||||||
|
const onclickAttr = this.getAttribute('onclick');
|
||||||
|
if (onclickAttr) {
|
||||||
|
eval(onclickAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
const href = this.getAttribute('href');
|
||||||
|
if (href && href !== '#') {
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Close dropdown when clicking outside
|
||||||
|
document.addEventListener("click", function() {
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Open client details page
|
||||||
|
function openClientDetailsPage(clientId) {
|
||||||
|
$('.loader').fadeIn();
|
||||||
|
$('.loader-mask').fadeIn();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "<?= base_url('util/get-client-details/') ?>" + clientId,
|
||||||
|
type: "GET",
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(res) {
|
||||||
|
$('.loader').fadeOut();
|
||||||
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
|
|
||||||
|
$('#append_client_info').empty().append(res.data);
|
||||||
|
$('#client_info').show();
|
||||||
|
$('#client_list').hide();
|
||||||
|
},
|
||||||
|
error: function(xhr, status, error) {
|
||||||
|
console.error(xhr.responseText);
|
||||||
|
console.error(status, error);
|
||||||
|
$('.loader').fadeOut();
|
||||||
|
$('.loader-mask').delay(350).fadeOut('slow');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|||||||
@ -894,14 +894,14 @@
|
|||||||
if (res.data.is_addon == 2 || res.data.is_addon == 3) {
|
if (res.data.is_addon == 2 || res.data.is_addon == 3) {
|
||||||
|
|
||||||
$("#insurer").next(".select2-container").css({
|
$("#insurer").next(".select2-container").css({
|
||||||
'pointer-events': 'none',
|
'pointer-events': 'auto',
|
||||||
});
|
});
|
||||||
$('#select2-insurer-container').css({
|
$('#select2-insurer-container').css({
|
||||||
'background-color': '#ebebe0',
|
'background-color': '#ebebe0',
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#tpa").next(".select2-container").css({
|
$("#tpa").next(".select2-container").css({
|
||||||
'pointer-events': 'none',
|
'pointer-events': 'auto',
|
||||||
});
|
});
|
||||||
$('#select2-tpa-container').css({
|
$('#select2-tpa-container').css({
|
||||||
'background-color': '#ebebe0',
|
'background-color': '#ebebe0',
|
||||||
@ -1356,7 +1356,7 @@
|
|||||||
if ($(this).val() == 4 || $(this).val() == 5) {
|
if ($(this).val() == 4 || $(this).val() == 5) {
|
||||||
|
|
||||||
$("#insurer").next(".select2-container").css({
|
$("#insurer").next(".select2-container").css({
|
||||||
'pointer-events': 'none',
|
'pointer-events': 'auto',
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#select2-insurer-container').css({
|
$('#select2-insurer-container').css({
|
||||||
@ -1364,7 +1364,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$("#tpa").next(".select2-container").css({
|
$("#tpa").next(".select2-container").css({
|
||||||
'pointer-events': 'none',
|
'pointer-events': 'auto',
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#select2-tpa-container').css({
|
$('#select2-tpa-container').css({
|
||||||
@ -1927,14 +1927,14 @@
|
|||||||
if (res.data.is_addon == 2 || res.data.is_addon == 3) {
|
if (res.data.is_addon == 2 || res.data.is_addon == 3) {
|
||||||
|
|
||||||
$("#insurer").next(".select2-container").css({
|
$("#insurer").next(".select2-container").css({
|
||||||
'pointer-events': 'none',
|
'pointer-events': 'auto',
|
||||||
});
|
});
|
||||||
$('#select2-insurer-container').css({
|
$('#select2-insurer-container').css({
|
||||||
'background-color': '#ebebe0',
|
'background-color': '#ebebe0',
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#tpa").next(".select2-container").css({
|
$("#tpa").next(".select2-container").css({
|
||||||
'pointer-events': 'none',
|
'pointer-events': 'auto',
|
||||||
});
|
});
|
||||||
$('#select2-tpa-container').css({
|
$('#select2-tpa-container').css({
|
||||||
'background-color': '#ebebe0',
|
'background-color': '#ebebe0',
|
||||||
|
|||||||
@ -18,6 +18,33 @@ table.dataTable tbody td {
|
|||||||
color: white !important;
|
color: white !important;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
background-color: #ffffff !important;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
min-width: 10rem;
|
||||||
|
z-index: 9999;
|
||||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item {
|
||||||
|
display: block !important;
|
||||||
|
width: 100% !important;
|
||||||
|
padding: 0.5rem 1rem !important;
|
||||||
|
color: #212529 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item:hover {
|
||||||
|
background-color: #f8f9fa !important;
|
||||||
|
color: #16181b !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -113,7 +140,94 @@ table.dataTable tbody td {
|
|||||||
|
|
||||||
<!-- end row -->
|
<!-- end row -->
|
||||||
<div id="loader" class="loader" style="display:none;">SPINNER</div>
|
<div id="loader" class="loader" style="display:none;">SPINNER</div>
|
||||||
|
<script>
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const table = document.getElementById("tickets-table");
|
||||||
|
|
||||||
|
// Create custom dropdown
|
||||||
|
function createCustomDropdown(row) {
|
||||||
|
// Get the original dropdown items
|
||||||
|
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||||
|
if (!originalDropdown) return null;
|
||||||
|
|
||||||
|
// Create new dropdown with proper background and spacing
|
||||||
|
const customDropdown = document.createElement('div');
|
||||||
|
customDropdown.className = 'custom-dropdown-menu';
|
||||||
|
|
||||||
|
// Copy inner content while maintaining icon alignment
|
||||||
|
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||||
|
|
||||||
|
return customDropdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
let activeDropdown = null;
|
||||||
|
|
||||||
|
// Add click event listener to rows
|
||||||
|
table.querySelectorAll("tbody tr").forEach(row => {
|
||||||
|
const customDropdown = createCustomDropdown(row);
|
||||||
|
if (!customDropdown) return;
|
||||||
|
|
||||||
|
document.body.appendChild(customDropdown);
|
||||||
|
|
||||||
|
row.addEventListener("click", function(event) {
|
||||||
|
// Ignore clicks on the action column
|
||||||
|
if (event.target.closest('td:last-child')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide any active dropdown
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get click position
|
||||||
|
const rect = event.target.getBoundingClientRect();
|
||||||
|
|
||||||
|
// Position the dropdown with some offset
|
||||||
|
customDropdown.style.display = 'block';
|
||||||
|
customDropdown.style.position = 'fixed';
|
||||||
|
customDropdown.style.left = `${rect.left}px`;
|
||||||
|
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||||
|
|
||||||
|
// Set as active dropdown
|
||||||
|
activeDropdown = customDropdown;
|
||||||
|
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Preserve click handlers and add auto-close
|
||||||
|
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||||
|
item.addEventListener('click', function(e) {
|
||||||
|
const onclickAttr = this.getAttribute('onclick');
|
||||||
|
if (onclickAttr) {
|
||||||
|
eval(onclickAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
const href = this.getAttribute('href');
|
||||||
|
if (href && href !== '#') {
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close the dropdown after handling the click
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Close dropdown when clicking outside
|
||||||
|
document.addEventListener("click", function() {
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|||||||
@ -7,6 +7,32 @@
|
|||||||
.reload:hover {
|
.reload:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
.custom-dropdown-menu {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
background-color: #ffffff !important;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
min-width: 10rem;
|
||||||
|
z-index: 9999;
|
||||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item {
|
||||||
|
display: block !important;
|
||||||
|
width: 100% !important;
|
||||||
|
padding: 0.5rem 1rem !important;
|
||||||
|
color: #212529 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item:hover {
|
||||||
|
background-color: #f8f9fa !important;
|
||||||
|
color: #16181b !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
@ -160,7 +186,98 @@
|
|||||||
</div><!-- /.modal-content -->
|
</div><!-- /.modal-content -->
|
||||||
</div><!-- /.modal-dialog -->
|
</div><!-- /.modal-dialog -->
|
||||||
</div><!-- /.modal -->
|
</div><!-- /.modal -->
|
||||||
|
<script>
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const table = document.getElementById("tickets-table");
|
||||||
|
|
||||||
|
// Create custom dropdown
|
||||||
|
function createCustomDropdown(row) {
|
||||||
|
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||||
|
if (!originalDropdown) return null;
|
||||||
|
|
||||||
|
const customDropdown = document.createElement('div');
|
||||||
|
customDropdown.className = 'custom-dropdown-menu';
|
||||||
|
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||||
|
|
||||||
|
return customDropdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
let activeDropdown = null;
|
||||||
|
|
||||||
|
// Add click event listener to rows
|
||||||
|
table.querySelectorAll("tbody tr").forEach(row => {
|
||||||
|
const customDropdown = createCustomDropdown(row);
|
||||||
|
if (!customDropdown) return;
|
||||||
|
|
||||||
|
document.body.appendChild(customDropdown);
|
||||||
|
|
||||||
|
row.addEventListener("click", function(event) {
|
||||||
|
// Ignore clicks on the action column (like the dropdown itself)
|
||||||
|
if (event.target.closest('td:last-child')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide any active dropdown
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get click position
|
||||||
|
const rect = event.target.getBoundingClientRect();
|
||||||
|
|
||||||
|
// Position the dropdown with some offset
|
||||||
|
customDropdown.style.display = 'block';
|
||||||
|
customDropdown.style.position = 'fixed';
|
||||||
|
customDropdown.style.left = `${rect.left}px`;
|
||||||
|
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||||
|
|
||||||
|
// Set as active dropdown
|
||||||
|
activeDropdown = customDropdown;
|
||||||
|
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Preserve click handlers for modal actions
|
||||||
|
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||||
|
item.addEventListener('click', function(e) {
|
||||||
|
// Check if the clicked item is a modal trigger (view/reupload)
|
||||||
|
const isModalAction = this.hasAttribute('data-toggle') && this.getAttribute('data-toggle') === 'modal';
|
||||||
|
|
||||||
|
if (isModalAction) {
|
||||||
|
// Let the modal action proceed normally (no stopPropagation for modal triggers)
|
||||||
|
return; // No need to stop propagation for modal actions
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close the dropdown if it's not related to modal
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const onclickAttr = this.getAttribute('onclick');
|
||||||
|
if (onclickAttr) {
|
||||||
|
eval(onclickAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
const href = this.getAttribute('href');
|
||||||
|
if (href && href !== '#') {
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.stopPropagation(); // Prevent event from bubbling up for non-modal actions
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Close dropdown when clicking outside
|
||||||
|
document.addEventListener("click", function() {
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$('body').on('click', '.view_emp_list', function() {
|
$('body').on('click', '.view_emp_list', function() {
|
||||||
|
|||||||
@ -16,6 +16,32 @@ table.dataTable tbody td {
|
|||||||
.dataTables_filter {
|
.dataTables_filter {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
.custom-dropdown-menu {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
background-color: #ffffff !important;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
min-width: 10rem;
|
||||||
|
z-index: 9999;
|
||||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item {
|
||||||
|
display: block !important;
|
||||||
|
width: 100% !important;
|
||||||
|
padding: 0.5rem 1rem !important;
|
||||||
|
color: #212529 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item:hover {
|
||||||
|
background-color: #f8f9fa !important;
|
||||||
|
color: #16181b !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="row" id="finance_filter">
|
<div class="row" id="finance_filter">
|
||||||
@ -210,28 +236,97 @@ table.dataTable tbody td {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
// Get all rows of the table
|
const table = document.getElementById("scroll-horizontal-datatable");
|
||||||
const rows = document.querySelectorAll('#scroll-horizontal-datatable tbody tr');
|
|
||||||
|
|
||||||
rows.forEach(row => {
|
// Create custom dropdown
|
||||||
// Add a click event listener to each row
|
function createCustomDropdown(row) {
|
||||||
row.addEventListener('click', function(event) {
|
// Get the original dropdown items
|
||||||
// Find the dropdown toggle button inside the clicked row
|
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||||
const dropdownToggle = row.querySelector('.dropdown-toggle');
|
if (!originalDropdown) return null;
|
||||||
|
|
||||||
|
// Create new dropdown with proper background and spacing
|
||||||
|
const customDropdown = document.createElement('div');
|
||||||
|
customDropdown.className = 'custom-dropdown-menu';
|
||||||
|
|
||||||
|
// Copy inner content while maintaining icon alignment
|
||||||
|
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||||
|
|
||||||
|
return customDropdown;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if the clicked element is not the dropdown button itself to avoid unnecessary clicks
|
let activeDropdown = null;
|
||||||
if (dropdownToggle && !event.target.closest('.dropdown-menu')) {
|
|
||||||
// Manually trigger Bootstrap's dropdown toggle using Bootstrap's Dropdown class
|
// Add click event listener to rows
|
||||||
const dropdown = new bootstrap.Dropdown(dropdownToggle);
|
table.querySelectorAll("tbody tr").forEach(row => {
|
||||||
dropdown.toggle(); // Toggle the dropdown visibility
|
const customDropdown = createCustomDropdown(row);
|
||||||
|
if (!customDropdown) return;
|
||||||
|
|
||||||
|
// Append the custom dropdown to the body
|
||||||
|
document.body.appendChild(customDropdown);
|
||||||
|
|
||||||
|
row.addEventListener("click", function(event) {
|
||||||
|
// Ignore clicks on the action column
|
||||||
|
if (event.target.closest('td:last-child')) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hide any active dropdown
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get click position
|
||||||
|
const rect = event.target.getBoundingClientRect();
|
||||||
|
|
||||||
|
// Position the dropdown with some offset
|
||||||
|
customDropdown.style.display = 'block';
|
||||||
|
customDropdown.style.position = 'fixed';
|
||||||
|
customDropdown.style.left = `${rect.left}px`;
|
||||||
|
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||||
|
|
||||||
|
// Set as active dropdown
|
||||||
|
activeDropdown = customDropdown;
|
||||||
|
|
||||||
|
event.stopPropagation();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Preserve click handlers and add auto-close
|
||||||
|
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||||
|
item.addEventListener('click', function(e) {
|
||||||
|
const onclickAttr = this.getAttribute('onclick');
|
||||||
|
if (onclickAttr) {
|
||||||
|
eval(onclickAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
const href = this.getAttribute('href');
|
||||||
|
if (href && href !== '#') {
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close the dropdown after handling the click
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Close dropdown when clicking outside
|
||||||
|
document.addEventListener("click", function() {
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Datatable document ready
|
// Datatable document ready
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|||||||
@ -1,3 +1,71 @@
|
|||||||
|
<style>
|
||||||
|
custom-dropdown-menu {
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
background-color: #ffffff !important;
|
||||||
|
border: 1px solid rgba(0,0,0,.15);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
min-width: 10rem;
|
||||||
|
z-index: 9999;
|
||||||
|
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item {
|
||||||
|
display: block !important;
|
||||||
|
width: 100% !important;
|
||||||
|
padding: 0.5rem 1rem !important;
|
||||||
|
clear: both !important;
|
||||||
|
font-weight: 400 !important;
|
||||||
|
color: #212529 !important;
|
||||||
|
text-align: inherit !important;
|
||||||
|
white-space: nowrap !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
border: 0 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
position: relative !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item:hover {
|
||||||
|
background-color: #f8f9fa !important;
|
||||||
|
color: #16181b !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item i {
|
||||||
|
margin-right: 8px !important;
|
||||||
|
vertical-align: middle !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure the dropdown menu has a solid background */
|
||||||
|
.custom-dropdown-menu::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: #ffffff;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add a subtle backdrop effect */
|
||||||
|
.custom-dropdown-menu::after {
|
||||||
|
content: '';
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: rgba(0,0,0,0.05);
|
||||||
|
z-index: -2;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<div class="row" id="insurer_list">
|
<div class="row" id="insurer_list">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
@ -45,6 +113,97 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- end row -->
|
<!-- end row -->
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const table = document.getElementById("tickets-table");
|
||||||
|
|
||||||
|
// Create custom dropdown
|
||||||
|
function createCustomDropdown(row) {
|
||||||
|
// Get the original dropdown items
|
||||||
|
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||||
|
if (!originalDropdown) return null;
|
||||||
|
|
||||||
|
// Create new dropdown with proper background and spacing
|
||||||
|
const customDropdown = document.createElement('div');
|
||||||
|
customDropdown.className = 'custom-dropdown-menu';
|
||||||
|
|
||||||
|
// Copy inner content while maintaining icon alignment
|
||||||
|
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||||
|
|
||||||
|
return customDropdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
let activeDropdown = null;
|
||||||
|
|
||||||
|
// Add click event listener to rows
|
||||||
|
table.querySelectorAll("tbody tr").forEach(row => {
|
||||||
|
const customDropdown = createCustomDropdown(row);
|
||||||
|
if (!customDropdown) return;
|
||||||
|
|
||||||
|
document.body.appendChild(customDropdown);
|
||||||
|
|
||||||
|
row.addEventListener("click", function(event) {
|
||||||
|
// Ignore clicks on the action column
|
||||||
|
if (event.target.closest('td:last-child')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide any active dropdown
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get click position
|
||||||
|
const rect = event.target.getBoundingClientRect();
|
||||||
|
|
||||||
|
// Position the dropdown with some offset
|
||||||
|
customDropdown.style.display = 'block';
|
||||||
|
customDropdown.style.position = 'fixed';
|
||||||
|
customDropdown.style.left = `${rect.left}px`;
|
||||||
|
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||||
|
|
||||||
|
// Set as active dropdown
|
||||||
|
activeDropdown = customDropdown;
|
||||||
|
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Preserve click handlers and add auto-close
|
||||||
|
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||||
|
item.addEventListener('click', function(e) {
|
||||||
|
const onclickAttr = this.getAttribute('onclick');
|
||||||
|
if (onclickAttr) {
|
||||||
|
eval(onclickAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
const href = this.getAttribute('href');
|
||||||
|
if (href && href !== '#') {
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close the dropdown after handling the click
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Close dropdown when clicking outside
|
||||||
|
document.addEventListener("click", function() {
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|||||||
@ -107,12 +107,76 @@ table.dataTable tbody td {
|
|||||||
.disabled-option {
|
.disabled-option {
|
||||||
color: gray;
|
color: gray;
|
||||||
}
|
}
|
||||||
.dropdown-menu {
|
|
||||||
position: absolute !important;
|
custom-dropdown-menu {
|
||||||
z-index: 1050 !important; /* Ensures dropdown appears above other elements */
|
display: none;
|
||||||
transform: none !important; /* Prevents Bootstrap's default offset positioning */
|
position: fixed;
|
||||||
|
background-color: #ffffff !important;
|
||||||
|
border: 1px solid rgba(0,0,0,.15);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
min-width: 10rem;
|
||||||
|
z-index: 9999;
|
||||||
|
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item {
|
||||||
|
display: block !important;
|
||||||
|
width: 100% !important;
|
||||||
|
padding: 0.5rem 1rem !important;
|
||||||
|
clear: both !important;
|
||||||
|
font-weight: 400 !important;
|
||||||
|
color: #212529 !important;
|
||||||
|
text-align: inherit !important;
|
||||||
|
white-space: nowrap !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
border: 0 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
position: relative !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item:hover {
|
||||||
|
background-color: #f8f9fa !important;
|
||||||
|
color: #16181b !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item i {
|
||||||
|
margin-right: 8px !important;
|
||||||
|
vertical-align: middle !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure the dropdown menu has a solid background */
|
||||||
|
.custom-dropdown-menu::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: #ffffff;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add a subtle backdrop effect */
|
||||||
|
.custom-dropdown-menu::after {
|
||||||
|
content: '';
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: rgba(0,0,0,0.05);
|
||||||
|
z-index: -2;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="row" id="inception_list">
|
<div class="row" id="inception_list">
|
||||||
@ -421,31 +485,87 @@ table.dataTable tbody td {
|
|||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
const table = document.getElementById("tickets-table");
|
const table = document.getElementById("tickets-table");
|
||||||
|
|
||||||
|
// Create custom dropdown
|
||||||
|
function createCustomDropdown(row) {
|
||||||
|
// Get the original dropdown items
|
||||||
|
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||||
|
if (!originalDropdown) return null;
|
||||||
|
|
||||||
|
// Create new dropdown with proper background and spacing
|
||||||
|
const customDropdown = document.createElement('div');
|
||||||
|
customDropdown.className = 'custom-dropdown-menu';
|
||||||
|
|
||||||
|
// Copy inner content while maintaining icon alignment
|
||||||
|
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||||
|
|
||||||
|
return customDropdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
let activeDropdown = null;
|
||||||
|
|
||||||
// Add click event listener to rows
|
// Add click event listener to rows
|
||||||
table.querySelectorAll("tbody tr").forEach(row => {
|
table.querySelectorAll("tbody tr").forEach(row => {
|
||||||
row.addEventListener("click", function (event) {
|
const customDropdown = createCustomDropdown(row);
|
||||||
// Check if the clicked element is inside the dropdown
|
if (!customDropdown) return;
|
||||||
if (event.target.closest(".dropdown-toggle") || event.target.closest(".dropdown-menu")) {
|
|
||||||
return; // Do nothing if the dropdown or its menu is clicked
|
document.body.appendChild(customDropdown);
|
||||||
|
|
||||||
|
row.addEventListener("click", function(event) {
|
||||||
|
// Ignore clicks on the action column
|
||||||
|
if (event.target.closest('td:last-child')) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trigger dropdown menu programmatically
|
// Hide any active dropdown
|
||||||
const dropdownToggle = this.querySelector(".dropdown-toggle");
|
if (activeDropdown) {
|
||||||
if (dropdownToggle) {
|
activeDropdown.style.display = 'none';
|
||||||
const dropdown = new bootstrap.Dropdown(dropdownToggle); // Bootstrap instance
|
|
||||||
dropdown.toggle(); // Toggle dropdown visibility
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get click position
|
||||||
|
const rect = event.target.getBoundingClientRect();
|
||||||
|
|
||||||
|
// Position the dropdown with some offset
|
||||||
|
customDropdown.style.display = 'block';
|
||||||
|
customDropdown.style.position = 'fixed';
|
||||||
|
customDropdown.style.left = `${rect.left}px`;
|
||||||
|
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||||
|
|
||||||
|
// Set as active dropdown
|
||||||
|
activeDropdown = customDropdown;
|
||||||
|
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Preserve click handlers and add auto-close
|
||||||
|
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||||
|
item.addEventListener('click', function(e) {
|
||||||
|
const onclickAttr = this.getAttribute('onclick');
|
||||||
|
if (onclickAttr) {
|
||||||
|
eval(onclickAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
const href = this.getAttribute('href');
|
||||||
|
if (href && href !== '#') {
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close the dropdown after handling the click
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Close dropdowns when clicking outside the table
|
// Close dropdown when clicking outside
|
||||||
document.addEventListener("click", function (event) {
|
document.addEventListener("click", function() {
|
||||||
if (!event.target.closest("#tickets-table")) {
|
if (activeDropdown) {
|
||||||
const openDropdowns = document.querySelectorAll(".dropdown-menu.show");
|
activeDropdown.style.display = 'none';
|
||||||
openDropdowns.forEach(menu => {
|
activeDropdown = null;
|
||||||
menu.classList.remove("show");
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,3 +1,71 @@
|
|||||||
|
<style>
|
||||||
|
custom-dropdown-menu {
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
background-color: #ffffff !important;
|
||||||
|
border: 1px solid rgba(0,0,0,.15);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
min-width: 10rem;
|
||||||
|
z-index: 9999;
|
||||||
|
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item {
|
||||||
|
display: block !important;
|
||||||
|
width: 100% !important;
|
||||||
|
padding: 0.5rem 1rem !important;
|
||||||
|
clear: both !important;
|
||||||
|
font-weight: 400 !important;
|
||||||
|
color: #212529 !important;
|
||||||
|
text-align: inherit !important;
|
||||||
|
white-space: nowrap !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
border: 0 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
position: relative !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item:hover {
|
||||||
|
background-color: #f8f9fa !important;
|
||||||
|
color: #16181b !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item i {
|
||||||
|
margin-right: 8px !important;
|
||||||
|
vertical-align: middle !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure the dropdown menu has a solid background */
|
||||||
|
.custom-dropdown-menu::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: #ffffff;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add a subtle backdrop effect */
|
||||||
|
.custom-dropdown-menu::after {
|
||||||
|
content: '';
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: rgba(0,0,0,0.05);
|
||||||
|
z-index: -2;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<div class="row" id="kyc_list">
|
<div class="row" id="kyc_list">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
@ -42,7 +110,94 @@
|
|||||||
</div><!-- end col -->
|
</div><!-- end col -->
|
||||||
</div>
|
</div>
|
||||||
<!-- end row -->
|
<!-- end row -->
|
||||||
|
<script>
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const table = document.getElementById("tickets-table");
|
||||||
|
|
||||||
|
// Create custom dropdown
|
||||||
|
function createCustomDropdown(row) {
|
||||||
|
// Get the original dropdown items
|
||||||
|
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||||
|
if (!originalDropdown) return null;
|
||||||
|
|
||||||
|
// Create new dropdown with proper background and spacing
|
||||||
|
const customDropdown = document.createElement('div');
|
||||||
|
customDropdown.className = 'custom-dropdown-menu';
|
||||||
|
|
||||||
|
// Copy inner content while maintaining icon alignment
|
||||||
|
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||||
|
|
||||||
|
return customDropdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
let activeDropdown = null;
|
||||||
|
|
||||||
|
// Add click event listener to rows
|
||||||
|
table.querySelectorAll("tbody tr").forEach(row => {
|
||||||
|
const customDropdown = createCustomDropdown(row);
|
||||||
|
if (!customDropdown) return;
|
||||||
|
|
||||||
|
document.body.appendChild(customDropdown);
|
||||||
|
|
||||||
|
row.addEventListener("click", function(event) {
|
||||||
|
// Ignore clicks on the action column
|
||||||
|
if (event.target.closest('td:last-child')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide any active dropdown
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get click position
|
||||||
|
const rect = event.target.getBoundingClientRect();
|
||||||
|
|
||||||
|
// Position the dropdown with some offset
|
||||||
|
customDropdown.style.display = 'block';
|
||||||
|
customDropdown.style.position = 'fixed';
|
||||||
|
customDropdown.style.left = `${rect.left}px`;
|
||||||
|
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||||
|
|
||||||
|
// Set as active dropdown
|
||||||
|
activeDropdown = customDropdown;
|
||||||
|
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Preserve click handlers and add auto-close
|
||||||
|
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||||
|
item.addEventListener('click', function(e) {
|
||||||
|
const onclickAttr = this.getAttribute('onclick');
|
||||||
|
if (onclickAttr) {
|
||||||
|
eval(onclickAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
const href = this.getAttribute('href');
|
||||||
|
if (href && href !== '#') {
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close the dropdown after handling the click
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Close dropdown when clicking outside
|
||||||
|
document.addEventListener("click", function() {
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|||||||
@ -36,6 +36,73 @@ table.dataTable tbody td {
|
|||||||
padding: 10px;
|
padding: 10px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
custom-dropdown-menu {
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
background-color: #ffffff !important;
|
||||||
|
border: 1px solid rgba(0,0,0,.15);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
min-width: 10rem;
|
||||||
|
z-index: 9999;
|
||||||
|
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item {
|
||||||
|
display: block !important;
|
||||||
|
width: 100% !important;
|
||||||
|
padding: 0.5rem 1rem !important;
|
||||||
|
clear: both !important;
|
||||||
|
font-weight: 400 !important;
|
||||||
|
color: #212529 !important;
|
||||||
|
text-align: inherit !important;
|
||||||
|
white-space: nowrap !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
border: 0 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
position: relative !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item:hover {
|
||||||
|
background-color: #f8f9fa !important;
|
||||||
|
color: #16181b !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item i {
|
||||||
|
margin-right: 8px !important;
|
||||||
|
vertical-align: middle !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure the dropdown menu has a solid background */
|
||||||
|
.custom-dropdown-menu::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: #ffffff;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add a subtle backdrop effect */
|
||||||
|
.custom-dropdown-menu::after {
|
||||||
|
content: '';
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: rgba(0,0,0,0.05);
|
||||||
|
z-index: -2;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
@ -132,6 +199,97 @@ table.dataTable tbody td {
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const table = document.getElementById("tickets-table");
|
||||||
|
|
||||||
|
// Create custom dropdown
|
||||||
|
function createCustomDropdown(row) {
|
||||||
|
// Get the original dropdown items
|
||||||
|
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||||
|
if (!originalDropdown) return null;
|
||||||
|
|
||||||
|
// Create new dropdown with proper background and spacing
|
||||||
|
const customDropdown = document.createElement('div');
|
||||||
|
customDropdown.className = 'custom-dropdown-menu';
|
||||||
|
|
||||||
|
// Copy inner content while maintaining icon alignment
|
||||||
|
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||||
|
|
||||||
|
return customDropdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
let activeDropdown = null;
|
||||||
|
|
||||||
|
// Add click event listener to rows
|
||||||
|
table.querySelectorAll("tbody tr").forEach(row => {
|
||||||
|
const customDropdown = createCustomDropdown(row);
|
||||||
|
if (!customDropdown) return;
|
||||||
|
|
||||||
|
document.body.appendChild(customDropdown);
|
||||||
|
|
||||||
|
row.addEventListener("click", function(event) {
|
||||||
|
// Ignore clicks on the action column
|
||||||
|
if (event.target.closest('td:last-child')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide any active dropdown
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get click position
|
||||||
|
const rect = event.target.getBoundingClientRect();
|
||||||
|
|
||||||
|
// Position the dropdown with some offset
|
||||||
|
customDropdown.style.display = 'block';
|
||||||
|
customDropdown.style.position = 'fixed';
|
||||||
|
customDropdown.style.left = `${rect.left}px`;
|
||||||
|
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||||
|
|
||||||
|
// Set as active dropdown
|
||||||
|
activeDropdown = customDropdown;
|
||||||
|
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Preserve click handlers and add auto-close
|
||||||
|
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||||
|
item.addEventListener('click', function(e) {
|
||||||
|
const onclickAttr = this.getAttribute('onclick');
|
||||||
|
if (onclickAttr) {
|
||||||
|
eval(onclickAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
const href = this.getAttribute('href');
|
||||||
|
if (href && href !== '#') {
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close the dropdown after handling the click
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Close dropdown when clicking outside
|
||||||
|
document.addEventListener("click", function() {
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
var client_list = ''; // local variable for storing the client branch list
|
var client_list = ''; // local variable for storing the client branch list
|
||||||
var branch_list = ''; // local variable for storing the client branch list
|
var branch_list = ''; // local variable for storing the client branch list
|
||||||
var policy_list = ''; // local variable for storing the client policy list
|
var policy_list = ''; // local variable for storing the client policy list
|
||||||
|
|||||||
@ -36,6 +36,73 @@ table.dataTable thead th {
|
|||||||
padding: 10px;
|
padding: 10px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
custom-dropdown-menu {
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
background-color: #ffffff !important;
|
||||||
|
border: 1px solid rgba(0,0,0,.15);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
min-width: 10rem;
|
||||||
|
z-index: 9999;
|
||||||
|
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item {
|
||||||
|
display: block !important;
|
||||||
|
width: 100% !important;
|
||||||
|
padding: 0.5rem 1rem !important;
|
||||||
|
clear: both !important;
|
||||||
|
font-weight: 400 !important;
|
||||||
|
color: #212529 !important;
|
||||||
|
text-align: inherit !important;
|
||||||
|
white-space: nowrap !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
border: 0 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
position: relative !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item:hover {
|
||||||
|
background-color: #f8f9fa !important;
|
||||||
|
color: #16181b !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item i {
|
||||||
|
margin-right: 8px !important;
|
||||||
|
vertical-align: middle !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure the dropdown menu has a solid background */
|
||||||
|
.custom-dropdown-menu::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: #ffffff;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add a subtle backdrop effect */
|
||||||
|
.custom-dropdown-menu::after {
|
||||||
|
content: '';
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: rgba(0,0,0,0.05);
|
||||||
|
z-index: -2;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="row" id="endorsement_filter">
|
<div class="row" id="endorsement_filter">
|
||||||
@ -236,31 +303,87 @@ table.dataTable thead th {
|
|||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
const table = document.getElementById("tickets-table");
|
const table = document.getElementById("tickets-table");
|
||||||
|
|
||||||
|
// Create custom dropdown
|
||||||
|
function createCustomDropdown(row) {
|
||||||
|
// Get the original dropdown items
|
||||||
|
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||||
|
if (!originalDropdown) return null;
|
||||||
|
|
||||||
|
// Create new dropdown with proper background and spacing
|
||||||
|
const customDropdown = document.createElement('div');
|
||||||
|
customDropdown.className = 'custom-dropdown-menu';
|
||||||
|
|
||||||
|
// Copy inner content while maintaining icon alignment
|
||||||
|
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||||
|
|
||||||
|
return customDropdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
let activeDropdown = null;
|
||||||
|
|
||||||
// Add click event listener to rows
|
// Add click event listener to rows
|
||||||
table.querySelectorAll("tbody tr").forEach(row => {
|
table.querySelectorAll("tbody tr").forEach(row => {
|
||||||
row.addEventListener("click", function (event) {
|
const customDropdown = createCustomDropdown(row);
|
||||||
// Check if the clicked element is inside the dropdown
|
if (!customDropdown) return;
|
||||||
if (event.target.closest(".dropdown-toggle") || event.target.closest(".dropdown-menu")) {
|
|
||||||
return; // Do nothing if the dropdown or its menu is clicked
|
document.body.appendChild(customDropdown);
|
||||||
|
|
||||||
|
row.addEventListener("click", function(event) {
|
||||||
|
// Ignore clicks on the action column
|
||||||
|
if (event.target.closest('td:last-child')) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trigger dropdown menu programmatically
|
// Hide any active dropdown
|
||||||
const dropdownToggle = this.querySelector(".dropdown-toggle");
|
if (activeDropdown) {
|
||||||
if (dropdownToggle) {
|
activeDropdown.style.display = 'none';
|
||||||
const dropdown = new bootstrap.Dropdown(dropdownToggle); // Bootstrap instance
|
|
||||||
dropdown.toggle(); // Toggle dropdown visibility
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get click position
|
||||||
|
const rect = event.target.getBoundingClientRect();
|
||||||
|
|
||||||
|
// Position the dropdown with some offset
|
||||||
|
customDropdown.style.display = 'block';
|
||||||
|
customDropdown.style.position = 'fixed';
|
||||||
|
customDropdown.style.left = `${rect.left}px`;
|
||||||
|
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||||
|
|
||||||
|
// Set as active dropdown
|
||||||
|
activeDropdown = customDropdown;
|
||||||
|
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Preserve click handlers and add auto-close
|
||||||
|
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||||
|
item.addEventListener('click', function(e) {
|
||||||
|
const onclickAttr = this.getAttribute('onclick');
|
||||||
|
if (onclickAttr) {
|
||||||
|
eval(onclickAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
const href = this.getAttribute('href');
|
||||||
|
if (href && href !== '#') {
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close the dropdown after handling the click
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Close dropdowns when clicking outside the table
|
// Close dropdown when clicking outside
|
||||||
document.addEventListener("click", function (event) {
|
document.addEventListener("click", function() {
|
||||||
if (!event.target.closest("#tickets-table")) {
|
if (activeDropdown) {
|
||||||
const openDropdowns = document.querySelectorAll(".dropdown-menu.show");
|
activeDropdown.style.display = 'none';
|
||||||
openDropdowns.forEach(menu => {
|
activeDropdown = null;
|
||||||
menu.classList.remove("show");
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -45,10 +45,71 @@ table.dataTable tbody td {
|
|||||||
.addbtnStyle{
|
.addbtnStyle{
|
||||||
margin-left: 20px !important;
|
margin-left: 20px !important;
|
||||||
}
|
}
|
||||||
.dropdown-menu {
|
custom-dropdown-menu {
|
||||||
position: absolute !important;
|
display: none;
|
||||||
z-index: 1050 !important; /* Ensures dropdown appears above other elements */
|
position: fixed;
|
||||||
transform: none !important; /* Prevents Bootstrap's default offset positioning */
|
background-color: #ffffff !important;
|
||||||
|
border: 1px solid rgba(0,0,0,.15);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
min-width: 10rem;
|
||||||
|
z-index: 9999;
|
||||||
|
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item {
|
||||||
|
display: block !important;
|
||||||
|
width: 100% !important;
|
||||||
|
padding: 0.5rem 1rem !important;
|
||||||
|
clear: both !important;
|
||||||
|
font-weight: 400 !important;
|
||||||
|
color: #212529 !important;
|
||||||
|
text-align: inherit !important;
|
||||||
|
white-space: nowrap !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
border: 0 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
position: relative !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item:hover {
|
||||||
|
background-color: #f8f9fa !important;
|
||||||
|
color: #16181b !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item i {
|
||||||
|
margin-right: 8px !important;
|
||||||
|
vertical-align: middle !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure the dropdown menu has a solid background */
|
||||||
|
.custom-dropdown-menu::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: #ffffff;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add a subtle backdrop effect */
|
||||||
|
.custom-dropdown-menu::after {
|
||||||
|
content: '';
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: rgba(0,0,0,0.05);
|
||||||
|
z-index: -2;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
@ -349,35 +410,90 @@ table.dataTable tbody td {
|
|||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
const table = document.getElementById("tickets-table");
|
const table = document.getElementById("tickets-table");
|
||||||
|
|
||||||
|
// Create custom dropdown
|
||||||
|
function createCustomDropdown(row) {
|
||||||
|
// Get the original dropdown items
|
||||||
|
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||||
|
if (!originalDropdown) return null;
|
||||||
|
|
||||||
|
// Create new dropdown with proper background and spacing
|
||||||
|
const customDropdown = document.createElement('div');
|
||||||
|
customDropdown.className = 'custom-dropdown-menu';
|
||||||
|
|
||||||
|
// Copy inner content while maintaining icon alignment
|
||||||
|
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||||
|
|
||||||
|
return customDropdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
let activeDropdown = null;
|
||||||
|
|
||||||
// Add click event listener to rows
|
// Add click event listener to rows
|
||||||
table.querySelectorAll("tbody tr").forEach(row => {
|
table.querySelectorAll("tbody tr").forEach(row => {
|
||||||
row.addEventListener("click", function (event) {
|
const customDropdown = createCustomDropdown(row);
|
||||||
// Check if the clicked element is inside the dropdown
|
if (!customDropdown) return;
|
||||||
if (event.target.closest(".dropdown-toggle") || event.target.closest(".dropdown-menu")) {
|
|
||||||
return; // Do nothing if the dropdown or its menu is clicked
|
document.body.appendChild(customDropdown);
|
||||||
|
|
||||||
|
row.addEventListener("click", function(event) {
|
||||||
|
// Ignore clicks on the action column
|
||||||
|
if (event.target.closest('td:last-child')) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trigger dropdown menu programmatically
|
// Hide any active dropdown
|
||||||
const dropdownToggle = this.querySelector(".dropdown-toggle");
|
if (activeDropdown) {
|
||||||
if (dropdownToggle) {
|
activeDropdown.style.display = 'none';
|
||||||
const dropdown = new bootstrap.Dropdown(dropdownToggle); // Bootstrap instance
|
|
||||||
dropdown.toggle(); // Toggle dropdown visibility
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get click position
|
||||||
|
const rect = event.target.getBoundingClientRect();
|
||||||
|
|
||||||
|
// Position the dropdown with some offset
|
||||||
|
customDropdown.style.display = 'block';
|
||||||
|
customDropdown.style.position = 'fixed';
|
||||||
|
customDropdown.style.left = `${rect.left}px`;
|
||||||
|
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||||
|
|
||||||
|
// Set as active dropdown
|
||||||
|
activeDropdown = customDropdown;
|
||||||
|
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Preserve click handlers and add auto-close
|
||||||
|
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||||
|
item.addEventListener('click', function(e) {
|
||||||
|
const onclickAttr = this.getAttribute('onclick');
|
||||||
|
if (onclickAttr) {
|
||||||
|
eval(onclickAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
const href = this.getAttribute('href');
|
||||||
|
if (href && href !== '#') {
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close the dropdown after handling the click
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Close dropdowns when clicking outside the table
|
// Close dropdown when clicking outside
|
||||||
document.addEventListener("click", function (event) {
|
document.addEventListener("click", function() {
|
||||||
if (!event.target.closest("#tickets-table")) {
|
if (activeDropdown) {
|
||||||
const openDropdowns = document.querySelectorAll(".dropdown-menu.show");
|
activeDropdown.style.display = 'none';
|
||||||
openDropdowns.forEach(menu => {
|
activeDropdown = null;
|
||||||
menu.classList.remove("show");
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@ -1,3 +1,71 @@
|
|||||||
|
<style>
|
||||||
|
.custom-dropdown-menu {
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
background-color: #ffffff !important;
|
||||||
|
border: 1px solid rgba(0,0,0,.15);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
min-width: 10rem;
|
||||||
|
z-index: 9999;
|
||||||
|
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item {
|
||||||
|
display: block !important;
|
||||||
|
width: 100% !important;
|
||||||
|
padding: 0.5rem 1rem !important;
|
||||||
|
clear: both !important;
|
||||||
|
font-weight: 400 !important;
|
||||||
|
color: #212529 !important;
|
||||||
|
text-align: inherit !important;
|
||||||
|
white-space: nowrap !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
border: 0 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
position: relative !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item:hover {
|
||||||
|
background-color: #f8f9fa !important;
|
||||||
|
color: #16181b !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item i {
|
||||||
|
margin-right: 8px !important;
|
||||||
|
vertical-align: middle !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure the dropdown menu has a solid background */
|
||||||
|
.custom-dropdown-menu::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: #ffffff;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add a subtle backdrop effect */
|
||||||
|
.custom-dropdown-menu::after {
|
||||||
|
content: '';
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: rgba(0,0,0,0.05);
|
||||||
|
z-index: -2;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<div class="row" id="policy_list">
|
<div class="row" id="policy_list">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
@ -51,6 +119,90 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- end row -->
|
<!-- end row -->
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const table = document.getElementById("tickets-table");
|
||||||
|
|
||||||
|
// Create custom dropdown
|
||||||
|
function createCustomDropdown(row) {
|
||||||
|
// Get the original dropdown items
|
||||||
|
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||||
|
if (!originalDropdown) return null;
|
||||||
|
|
||||||
|
// Create new dropdown with proper background and spacing
|
||||||
|
const customDropdown = document.createElement('div');
|
||||||
|
customDropdown.className = 'custom-dropdown-menu';
|
||||||
|
|
||||||
|
// Copy inner content while maintaining icon alignment
|
||||||
|
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||||
|
|
||||||
|
return customDropdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
let activeDropdown = null;
|
||||||
|
|
||||||
|
// Add click event listener to rows
|
||||||
|
table.querySelectorAll("tbody tr").forEach(row => {
|
||||||
|
const customDropdown = createCustomDropdown(row);
|
||||||
|
if (!customDropdown) return;
|
||||||
|
|
||||||
|
document.body.appendChild(customDropdown);
|
||||||
|
|
||||||
|
row.addEventListener("click", function(event) {
|
||||||
|
// Ignore clicks on the action column
|
||||||
|
if (event.target.closest('td:last-child')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide any active dropdown
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get click position
|
||||||
|
const rect = event.target.getBoundingClientRect();
|
||||||
|
|
||||||
|
// Position the dropdown with some offset
|
||||||
|
customDropdown.style.display = 'block';
|
||||||
|
customDropdown.style.position = 'fixed';
|
||||||
|
customDropdown.style.left = `${rect.left}px`;
|
||||||
|
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||||
|
|
||||||
|
// Set as active dropdown
|
||||||
|
activeDropdown = customDropdown;
|
||||||
|
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Preserve click handlers
|
||||||
|
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||||
|
item.addEventListener('click', function(e) {
|
||||||
|
const onclickAttr = this.getAttribute('onclick');
|
||||||
|
if (onclickAttr) {
|
||||||
|
eval(onclickAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
const href = this.getAttribute('href');
|
||||||
|
if (href && href !== '#') {
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Close dropdown when clicking outside
|
||||||
|
document.addEventListener("click", function() {
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|||||||
@ -61,6 +61,32 @@
|
|||||||
opacity: 0.5; /* Darken backdrop for better focus */
|
opacity: 0.5; /* Darken backdrop for better focus */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
background-color: #ffffff !important;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
min-width: 10rem;
|
||||||
|
z-index: 9999;
|
||||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item {
|
||||||
|
display: block !important;
|
||||||
|
width: 100% !important;
|
||||||
|
padding: 0.5rem 1rem !important;
|
||||||
|
color: #212529 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item:hover {
|
||||||
|
background-color: #f8f9fa !important;
|
||||||
|
color: #16181b !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@ -365,6 +391,95 @@
|
|||||||
</div>
|
</div>
|
||||||
</div><!-- /.modal -->
|
</div><!-- /.modal -->
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const table = document.getElementById("tickets-table");
|
||||||
|
|
||||||
|
// Create custom dropdown
|
||||||
|
function createCustomDropdown(row) {
|
||||||
|
// Get the original dropdown items
|
||||||
|
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||||
|
if (!originalDropdown) return null;
|
||||||
|
|
||||||
|
// Create new dropdown with proper background and spacing
|
||||||
|
const customDropdown = document.createElement('div');
|
||||||
|
customDropdown.className = 'custom-dropdown-menu';
|
||||||
|
|
||||||
|
// Copy inner content while maintaining icon alignment
|
||||||
|
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||||
|
|
||||||
|
return customDropdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
let activeDropdown = null;
|
||||||
|
|
||||||
|
// Add click event listener to rows
|
||||||
|
table.querySelectorAll("tbody tr").forEach(row => {
|
||||||
|
const customDropdown = createCustomDropdown(row);
|
||||||
|
if (!customDropdown) return;
|
||||||
|
|
||||||
|
document.body.appendChild(customDropdown);
|
||||||
|
|
||||||
|
row.addEventListener("click", function(event) {
|
||||||
|
// Ignore clicks on the action column
|
||||||
|
if (event.target.closest('td:last-child')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide any active dropdown
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get click position
|
||||||
|
const rect = event.target.getBoundingClientRect();
|
||||||
|
|
||||||
|
// Position the dropdown with some offset
|
||||||
|
customDropdown.style.display = 'block';
|
||||||
|
customDropdown.style.position = 'fixed';
|
||||||
|
customDropdown.style.left = `${rect.left}px`;
|
||||||
|
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||||
|
|
||||||
|
// Set as active dropdown
|
||||||
|
activeDropdown = customDropdown;
|
||||||
|
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Preserve click handlers and add auto-close
|
||||||
|
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||||
|
item.addEventListener('click', function(e) {
|
||||||
|
const onclickAttr = this.getAttribute('onclick');
|
||||||
|
if (onclickAttr) {
|
||||||
|
eval(onclickAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
const href = this.getAttribute('href');
|
||||||
|
if (href && href !== '#') {
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close the dropdown after handling the click
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Close dropdown when clicking outside
|
||||||
|
document.addEventListener("click", function() {
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function toggleAll(selectAllCheckbox) {
|
function toggleAll(selectAllCheckbox) {
|
||||||
const rowCheckboxes = document.querySelectorAll('.rowCheckbox');
|
const rowCheckboxes = document.querySelectorAll('.rowCheckbox');
|
||||||
|
|||||||
@ -1,3 +1,71 @@
|
|||||||
|
<style>
|
||||||
|
custom-dropdown-menu {
|
||||||
|
display: none;
|
||||||
|
position: fixed;
|
||||||
|
background-color: #ffffff !important;
|
||||||
|
border: 1px solid rgba(0,0,0,.15);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
min-width: 10rem;
|
||||||
|
z-index: 9999;
|
||||||
|
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item {
|
||||||
|
display: block !important;
|
||||||
|
width: 100% !important;
|
||||||
|
padding: 0.5rem 1rem !important;
|
||||||
|
clear: both !important;
|
||||||
|
font-weight: 400 !important;
|
||||||
|
color: #212529 !important;
|
||||||
|
text-align: inherit !important;
|
||||||
|
white-space: nowrap !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
border: 0 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
position: relative !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item:hover {
|
||||||
|
background-color: #f8f9fa !important;
|
||||||
|
color: #16181b !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item i {
|
||||||
|
margin-right: 8px !important;
|
||||||
|
vertical-align: middle !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.table tbody tr {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ensure the dropdown menu has a solid background */
|
||||||
|
.custom-dropdown-menu::before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: #ffffff;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add a subtle backdrop effect */
|
||||||
|
.custom-dropdown-menu::after {
|
||||||
|
content: '';
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: rgba(0,0,0,0.05);
|
||||||
|
z-index: -2;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<div class="row" id="tpa_list">
|
<div class="row" id="tpa_list">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
@ -42,6 +110,94 @@
|
|||||||
</div><!-- end col -->
|
</div><!-- end col -->
|
||||||
</div>
|
</div>
|
||||||
<!-- end row -->
|
<!-- end row -->
|
||||||
|
<script>
|
||||||
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
|
const table = document.getElementById("tickets-table");
|
||||||
|
|
||||||
|
// Create custom dropdown
|
||||||
|
function createCustomDropdown(row) {
|
||||||
|
// Get the original dropdown items
|
||||||
|
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||||
|
if (!originalDropdown) return null;
|
||||||
|
|
||||||
|
// Create new dropdown with proper background and spacing
|
||||||
|
const customDropdown = document.createElement('div');
|
||||||
|
customDropdown.className = 'custom-dropdown-menu';
|
||||||
|
|
||||||
|
// Copy inner content while maintaining icon alignment
|
||||||
|
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||||
|
|
||||||
|
return customDropdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
let activeDropdown = null;
|
||||||
|
|
||||||
|
// Add click event listener to rows
|
||||||
|
table.querySelectorAll("tbody tr").forEach(row => {
|
||||||
|
const customDropdown = createCustomDropdown(row);
|
||||||
|
if (!customDropdown) return;
|
||||||
|
|
||||||
|
document.body.appendChild(customDropdown);
|
||||||
|
|
||||||
|
row.addEventListener("click", function(event) {
|
||||||
|
// Ignore clicks on the action column
|
||||||
|
if (event.target.closest('td:last-child')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hide any active dropdown
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get click position
|
||||||
|
const rect = event.target.getBoundingClientRect();
|
||||||
|
|
||||||
|
// Position the dropdown with some offset
|
||||||
|
customDropdown.style.display = 'block';
|
||||||
|
customDropdown.style.position = 'fixed';
|
||||||
|
customDropdown.style.left = `${rect.left}px`;
|
||||||
|
customDropdown.style.top = `${rect.bottom + 5}px`; // Add 5px gap
|
||||||
|
|
||||||
|
// Set as active dropdown
|
||||||
|
activeDropdown = customDropdown;
|
||||||
|
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Preserve click handlers and add auto-close
|
||||||
|
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||||
|
item.addEventListener('click', function(e) {
|
||||||
|
const onclickAttr = this.getAttribute('onclick');
|
||||||
|
if (onclickAttr) {
|
||||||
|
eval(onclickAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
const href = this.getAttribute('href');
|
||||||
|
if (href && href !== '#') {
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close the dropdown after handling the click
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Close dropdown when clicking outside
|
||||||
|
document.addEventListener("click", function() {
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,32 @@ table.dataTable tbody td {
|
|||||||
background-color: #f0f0f0;
|
background-color: #f0f0f0;
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
.custom-dropdown-menu {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
background-color: #ffffff !important;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
padding: 0.5rem 0;
|
||||||
|
min-width: 10rem;
|
||||||
|
z-index: 9999;
|
||||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item {
|
||||||
|
display: block !important;
|
||||||
|
width: 100% !important;
|
||||||
|
padding: 0.5rem 1rem !important;
|
||||||
|
color: #212529 !important;
|
||||||
|
text-decoration: none !important;
|
||||||
|
background-color: transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.custom-dropdown-menu .dropdown-item:hover {
|
||||||
|
background-color: #f8f9fa !important;
|
||||||
|
color: #16181b !important;
|
||||||
|
cursor: pointer !important;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@ -327,40 +352,94 @@ table.dataTable tbody td {
|
|||||||
<!-- end of Client form content modal -->
|
<!-- end of Client form content modal -->
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
const table = document.getElementById("client_list");
|
const table = document.getElementById("scroll-horizontal-datatable");
|
||||||
|
|
||||||
|
// Create custom dropdown
|
||||||
|
function createCustomDropdown(row) {
|
||||||
|
// Get the original dropdown menu
|
||||||
|
const originalDropdown = row.querySelector('.dropdown-menu');
|
||||||
|
if (!originalDropdown) return null;
|
||||||
|
|
||||||
|
// Create new dropdown menu with the same content
|
||||||
|
const customDropdown = document.createElement('div');
|
||||||
|
customDropdown.className = 'custom-dropdown-menu';
|
||||||
|
|
||||||
|
// Copy content of the original dropdown
|
||||||
|
customDropdown.innerHTML = originalDropdown.innerHTML;
|
||||||
|
|
||||||
|
return customDropdown;
|
||||||
|
}
|
||||||
|
|
||||||
|
let activeDropdown = null;
|
||||||
|
|
||||||
// Add click event listener to rows
|
// Add click event listener to rows
|
||||||
table.querySelectorAll("tbody tr").forEach(row => {
|
table.querySelectorAll("tbody tr").forEach(row => {
|
||||||
row.addEventListener("click", function (event) {
|
const customDropdown = createCustomDropdown(row);
|
||||||
// Check if the clicked element is inside the dropdown or its menu
|
if (!customDropdown) return;
|
||||||
if (event.target.closest(".dropdown-toggle") || event.target.closest(".dropdown-menu")) {
|
|
||||||
return; // Do nothing if the dropdown or its menu is clicked
|
// Append custom dropdown to the body
|
||||||
|
document.body.appendChild(customDropdown);
|
||||||
|
|
||||||
|
row.addEventListener("click", function(event) {
|
||||||
|
// Prevent opening dropdown if clicking on the action column (button)
|
||||||
|
if (event.target.closest('td:last-child') || event.target.closest('.dropdown-toggle')) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trigger dropdown menu programmatically
|
// Close any existing active dropdown
|
||||||
const dropdownToggle = this.querySelector(".dropdown-toggle");
|
if (activeDropdown) {
|
||||||
if (dropdownToggle) {
|
activeDropdown.style.display = 'none';
|
||||||
const dropdown = new bootstrap.Dropdown(dropdownToggle); // Bootstrap instance
|
|
||||||
dropdown.toggle(); // Toggle dropdown visibility
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the position of the clicked cell
|
||||||
|
const rect = event.target.getBoundingClientRect();
|
||||||
|
|
||||||
|
// Position the dropdown based on where you click in the row (excluding action column)
|
||||||
|
customDropdown.style.display = 'block';
|
||||||
|
customDropdown.style.position = 'absolute';
|
||||||
|
customDropdown.style.left = `${rect.left + window.scrollX}px`; // Align with the clicked position
|
||||||
|
customDropdown.style.top = `${rect.bottom + window.scrollY + 5}px`; // 5px gap below the row
|
||||||
|
|
||||||
|
// Set this dropdown as the active one
|
||||||
|
activeDropdown = customDropdown;
|
||||||
|
|
||||||
|
event.stopPropagation(); // Prevent event from bubbling up
|
||||||
|
});
|
||||||
|
|
||||||
|
// Add click event to handle dropdown item actions
|
||||||
|
customDropdown.querySelectorAll('.dropdown-item').forEach(item => {
|
||||||
|
item.addEventListener('click', function(e) {
|
||||||
|
const onclickAttr = this.getAttribute('onclick');
|
||||||
|
if (onclickAttr) {
|
||||||
|
eval(onclickAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
const href = this.getAttribute('href');
|
||||||
|
if (href && href !== '#') {
|
||||||
|
window.location.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close the dropdown after handling the click
|
||||||
|
if (activeDropdown) {
|
||||||
|
activeDropdown.style.display = 'none';
|
||||||
|
activeDropdown = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
e.stopPropagation(); // Prevent event from bubbling up
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Close dropdowns when clicking outside the table or dropdown
|
// Close dropdown when clicking outside
|
||||||
document.addEventListener("click", function (event) {
|
document.addEventListener("click", function(event) {
|
||||||
// Check if click is outside of table and dropdown
|
if (activeDropdown && !event.target.closest('.custom-dropdown-menu')) {
|
||||||
const isClickInsideTable = event.target.closest("#client_list");
|
activeDropdown.style.display = 'none';
|
||||||
const isClickInsideDropdown = event.target.closest(".dropdown-toggle, .dropdown-menu");
|
activeDropdown = null;
|
||||||
|
|
||||||
if (!isClickInsideTable && !isClickInsideDropdown) {
|
|
||||||
// Close all dropdowns that are open
|
|
||||||
const openDropdowns = document.querySelectorAll(".dropdown-menu.show");
|
|
||||||
openDropdowns.forEach(menu => {
|
|
||||||
menu.classList.remove("show"); // Remove the 'show' class to hide the dropdown
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user