jbox-web/redmine_bootstrap_kit

View on GitHub
assets/javascripts/bootstrap/bootstrap_alert_helper.js

Summary

Maintainability
A
0 mins
Test Coverage
/*
BootstrapAlert
*/
function setBootstrapAlert(){
  $('.alert').each(function(index, element){
    $(element).alert();
  });
}

function addAlertMessage(object){
  $(object.target)
    .append(
      $('<div>')
        .attr('class', 'alert fade in ' + object.type)
        .html(object.message)
        .prepend(
          $('<button>')
            .attr('class', 'close')
            .attr('type', 'button')
            .attr('data-dismiss', 'alert')
            .html('&times;')
        )
    )

  setBootstrapAlert();
}