app/assets/javascripts/archangel/object/flash.js in archangel-0.3.0 vs app/assets/javascripts/archangel/object/flash.js in archangel-0.4.0
- old
+ new
@@ -32,17 +32,20 @@
return false;
}
type = type || 'warning';
- var messagesContainer = document.querySelector('#alert-messages'),
- msgContainer = document.createElement('div');
+ $('.alert-messages').append(
+ '<div class="alert alert-' + type + ' alert-link alert-dismissable" role="alert">' +
+ message +
+ '<button type="button" class="close" data-dismiss="alert" aria-label="Close">' +
+ '<span aria-hidden="true">×</span>' +
+ '</button>' +
+ '</div>');
- msgContainer.setAttribute('class', 'alert alert-' + type + ' alert-link alert-dismissable fade-in');
- msgContainer.setAttribute('role', 'alert');
- msgContainer.innerHTML = message;
-
- messagesContainer.appendChild(msgContainer);
+ setTimeout(function(){
+ $('.alert').alert('close');
+ }, 5000);
}
};
return object;
}(Archangel || {}));