app/assets/javascript/toastr_rails.js in toastr_rails-2.1.1 vs app/assets/javascript/toastr_rails.js in toastr_rails-2.1.3

- old
+ new

@@ -19,18 +19,24 @@ var showToast = function(flash){ for(var i = 0; i < flash.length; i++ ){ var msg = flash[i]; var type = { notice: 'success', + success: 'success', alert: 'error', + error: 'error', warning: 'warning', info: 'info' }; var options = { notice: {}, alert: { "timeOut": "0", "extendedTimeOut": "0" }, warning: { "timeOut": "0", "extendedTimeOut": "0" }, info: {} }; - toastr[type[msg[0]]](msg[1], '', options[msg[0]]); + try { + toastr[type[msg[0]]](msg[1], '', options[msg[0]]); + } catch(err) { + toastr.info(msg[1], '', options[msg[0]]); + } } };