Fixes show/hide for popovers on dash and on config

This commit is contained in:
Andrew 2021-09-28 20:15:29 -04:00
parent 9b089bc849
commit 97c74a873f
2 changed files with 32 additions and 5 deletions

View File

@ -81,9 +81,7 @@
<div class="card-header header-sm d-flex justify-content-between align-items-center">
<h4 class="card-title"><i class="fas fa-server"></i> &nbsp;{{ translate('dashboard', 'allServers') }}</h4>
{% if len(data['servers']) > 0 %}
<div class="d-md-none">
<span class="too_small" title="{{ translate('dashboard', 'cannotSeeOnMobile') }}", data-content="{{ translate('dashboard', 'cannotSeeOnMobile2') }}", data-placement="top"></span>
</div>
{% end %}
<div><a class="nav-link" href="/server/step1"><i class="fas fa-plus-circle"></i> &nbsp; {{ translate('dashboard', 'newServer') }}</a></div>
</div>
@ -226,7 +224,9 @@
<script>
$(document).ready(function(){
$('[data-toggle="popover"]').popover();
$('.too_small').popover("show");
if($(window).width() < 1000){
$('.too_small').popover("show");
}
});
$(window).ready(function(){
@ -234,6 +234,15 @@ $(document).ready(function(){
$('.too_small').popover("hide");
});
});
$(window).resize(function() {
// This will execute whenever the window is resized
if($(window).width() < 1000){
$('.too_small').popover("show");
}
else{
$('.too_small').popover("hide");
} // New width
});
</script>
<script>

View File

@ -92,7 +92,7 @@
<div class="card">
<div class="card-header header-sm d-flex justify-content-between align-items-center">
<h4 class="card-title"><i class="fas fa-user-tag"></i> Roles</h4>
<span class="too_small" title="{{ translate('dashboard', 'cannotSee') }}", data-content="{{ translate('dashboard', 'cannotSeeOnMobile2') }}", data-placement="top"></span>
<span class="too_small2" title="{{ translate('dashboard', 'cannotSee') }}", data-content="{{ translate('dashboard', 'cannotSeeOnMobile2') }}", data-placement="top"></span>
<div><a class="nav-link" href="/panel/add_role"><i class="fas fa-plus-circle"></i> &nbsp; Add New Role</a></div>
</div>
<div class="card-body">
@ -157,15 +157,33 @@
<script>
$(document).ready(function(){
$('[data-toggle="popover"]').popover();
if($(window).width() < 1000){
$('.too_small').popover("show");
$('.too_small2').popover("show");
}
});
$(window).ready(function(){
$('body').click(function(){
$('.too_small').popover("hide");
$('.too_small2').popover("hide");
});
});
$(window).resize(function() {
// This will execute whenever the window is resized
if($(window).width() < 1000){
$('.too_small').popover("show");
}
else{
$('.too_small').popover("hide");
} // New width
if($(window).width() < 1000){
$('.too_small2').popover("show");
}
else{
$('.too_small2').popover("hide");
} // New width
});
</script>
<script>