'; break; case 'alert-info': $alertIcon = ''; break; case 'alert-warning': $alertIcon = ''; break; case 'alert-missing-rebs-property': $alertIcon = ''; $alertMessageContent.css('padding', '0'); break; default: $alertIcon = ''; } $alertMessageContent.html($alertIcon.concat($message)); $alertMessage .addClass($type) .fadeIn(); } $(document).click(function (e) { if (!$alertMessage.is(e.target) && $alertMessage.has(e.target).length === 0) { $alertPanel.fadeOut(); $alertMessage.fadeOut(); } }); });