mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-18 13:38:14 +03:00
style: remove unused CSS and JavaScript for tooltips
This commit is contained in:
@@ -21,76 +21,11 @@ return view.extend({
|
|||||||
<meta http-equiv="Expires" content="0">
|
<meta http-equiv="Expires" content="0">
|
||||||
<style>
|
<style>
|
||||||
.cbi-value {
|
.cbi-value {
|
||||||
margin-bottom: 4px !important;
|
margin-bottom: 10px !important;
|
||||||
}
|
|
||||||
.cbi-value-field {
|
|
||||||
display: flex !important;
|
|
||||||
align-items: flex-start !important;
|
|
||||||
position: relative !important;
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
.cbi-value-description {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
.tooltip {
|
|
||||||
position: absolute !important;
|
|
||||||
background: #fff !important;
|
|
||||||
border: 1px solid #ccc !important;
|
|
||||||
border-radius: 4px !important;
|
|
||||||
padding: 8px !important;
|
|
||||||
max-width: 300px !important;
|
|
||||||
box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
|
|
||||||
z-index: 1000 !important;
|
|
||||||
color: #777777 !important;
|
|
||||||
font-size: 13px !important;
|
|
||||||
line-height: 1.4 !important;
|
|
||||||
}
|
|
||||||
.cbi-value-description::before {
|
|
||||||
display: none !important;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
`);
|
`);
|
||||||
|
|
||||||
// Add tooltip functionality
|
|
||||||
setTimeout(() => {
|
|
||||||
document.querySelectorAll('.cbi-value-field').forEach(field => {
|
|
||||||
const description = field.querySelector('.cbi-value-description');
|
|
||||||
if (description) {
|
|
||||||
const text = description.textContent;
|
|
||||||
let tooltip = null;
|
|
||||||
|
|
||||||
// Find all input elements within the field
|
|
||||||
const inputElements = field.querySelectorAll('input, select, textarea');
|
|
||||||
inputElements.forEach(inputElement => {
|
|
||||||
inputElement.addEventListener('mouseenter', (e) => {
|
|
||||||
tooltip = document.createElement('div');
|
|
||||||
tooltip.className = 'tooltip';
|
|
||||||
tooltip.textContent = text;
|
|
||||||
document.body.appendChild(tooltip);
|
|
||||||
|
|
||||||
const updatePosition = (e) => {
|
|
||||||
const rect = inputElement.getBoundingClientRect();
|
|
||||||
const scrollX = window.pageXOffset || document.documentElement.scrollLeft;
|
|
||||||
const scrollY = window.pageYOffset || document.documentElement.scrollTop;
|
|
||||||
tooltip.style.left = (e.pageX + 15) + 'px';
|
|
||||||
tooltip.style.top = (e.pageY + 10) + 'px';
|
|
||||||
};
|
|
||||||
|
|
||||||
updatePosition(e);
|
|
||||||
inputElement.addEventListener('mousemove', updatePosition);
|
|
||||||
});
|
|
||||||
|
|
||||||
inputElement.addEventListener('mouseleave', () => {
|
|
||||||
if (tooltip) {
|
|
||||||
tooltip.remove();
|
|
||||||
tooltip = null;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
var m, s, o;
|
var m, s, o;
|
||||||
|
|
||||||
m = new form.Map('podkop', _('Podkop configuration'), null, ['main', 'second']);
|
m = new form.Map('podkop', _('Podkop configuration'), null, ['main', 'second']);
|
||||||
|
|||||||
Reference in New Issue
Block a user