put the popup script to a separate file

This commit is contained in:
Paul Fournier 2023-11-02 14:34:22 +01:00
parent aa4fc7dede
commit 6cca5f6818
2 changed files with 13 additions and 10 deletions

View file

@ -610,7 +610,6 @@
<!-- Note: tipso plugin requires the full jQuery library, the slim one is not sufficient --> <!-- Note: tipso plugin requires the full jQuery library, the slim one is not sufficient -->
<!-- <script type="text/javascript" src="js/jquery-3.3.1.slim.min.js"></script> --> <!-- <script type="text/javascript" src="js/jquery-3.3.1.slim.min.js"></script> -->
<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script> <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="js/popup.js"></script>
<script type="text/javascript" src="js/tipso.min.js"></script> <script type="text/javascript" src="js/tipso.min.js"></script>
<script type="text/javascript" src="js/calendar.js"></script> <script type="text/javascript" src="js/calendar.js"></script>
@ -626,16 +625,9 @@
endDate: new Date(2023, 10, 26, 5), endDate: new Date(2023, 10, 26, 5),
groupEventsByLocation: true groupEventsByLocation: true
}); });
$('.popup-trigger').click(function(){
$(this).children($('.popup')).toggleClass("show")
});
$('.popup-trigger').mouseenter(function(){
$(this).children($('.popup')).addClass("show")
});
$('.popup-trigger').mouseleave(function(){
$(this).children($('.popup')).removeClass("show")
});
}); });
</script> </script>
<script type="text/javascript" src="js/popup.js"></script>
</html> </html>

11
www/js/popup.js Normal file
View file

@ -0,0 +1,11 @@
$(document).ready(() => {
$('.popup-trigger').click(function(){
$(this).children($('.popup')).toggleClass("show")
});
$('.popup-trigger').mouseenter(function(){
$(this).children($('.popup')).addClass("show")
});
$('.popup-trigger').mouseleave(function(){
$(this).children($('.popup')).removeClass("show")
});
});