I have code in my code that closes the window when I click outside the window, but the trouble is that inside this window there is a calendar that is needed for work, so when you click on this calendar, the window closes and trouble happens!
How to fix?
Bug:
Window closing code:
$(document).mouseup(function (e){ // ΡΠΎΠ±ΡΡΠΈΠ΅ ΠΊΠ»ΠΈΠΊΠ° ΠΏΠΎ Π²Π΅Π±-Π΄ΠΎΠΊΡΠΌΠ΅Π½ΡΡ if (!modal_content.is(e.target) // Π΅ΡΠ»ΠΈ ΠΊΠ»ΠΈΠΊ Π±ΡΠ» Π½Π΅ ΠΏΠΎ Π½Π°ΡΠ΅ΠΌΡ Π±Π»ΠΎΠΊΡ && modal_content.has(e.target).length === 0) { // ΠΈ Π½Π΅ ΠΏΠΎ Π΅Π³ΠΎ Π΄ΠΎΡΠ΅ΡΠ½ΠΈΠΌ ΡΠ»Π΅ΠΌΠ΅Π½ΡΠ°ΠΌ $modal.find('.modal-body').empty().end(); mcloced(addclassmodal); } }); 