// Modal function openModal(title, href) { // Fix - Select2 does not function properly when I use it inside a Bootstrap modal. $.fn.modal.Constructor.prototype.enforceFocus = function () { }; // Generazione dinamica modal do { id = '#bs-popup-' + Math.floor(Math.random() * 100); } while ($(id).length != 0); if ($(id).length == 0) { $('#modals').append('
'); } $(id).on('hidden.bs.modal', function () { if ($('.modal-backdrop').length < 1) { $(this).html(''); $(this).data('modal', null); } }); var content = '