{:uriI"file:///home/lxsameer/src/Yellowen/Faalis/app/assets/javascripts/faalis/dashboard/lib/flash_message.js?type=application/javascript&pipeline=self&id=5ab72ef9cde5800ac9317af3a94951607ae522962c1750938ca36ddd90cac162:ET:load_pathI">/home/lxsameer/src/Yellowen/Faalis/app/assets/javascripts;T:
filenameI"d/home/lxsameer/src/Yellowen/Faalis/app/assets/javascripts/faalis/dashboard/lib/flash_message.js;T: nameI"'faalis/dashboard/lib/flash_message;T:logical_pathI"/faalis/dashboard/lib/flash_message.self.js;T:content_typeI"application/javascript;T:sourceI"u/*
* Show a flash message on dashboard UI.
*
* Note: To create a theme for faalis dashboard
* you probably need to override this func
* in your theme assets.
*
* @OVERRIDE
*/
function show_flash_message(msg, klass) {
var icon = "";
if (klass == "success") {
icon = "check";
}
else if (klass == "error") {
icon = "ban";
klass = 'danger';
}
else if (klass == 'warning') {
icon = 'warning';
}
else if (klass == 'info') {
icon = 'info';
}
$("#flash-alert").removeClass().addClass("alert alert-dismissable alert-" + klass);
$("#flash-icon").removeClass().addClass("fa fa-" + icon);
$("#flash-msg").html(msg);
$("#flash-alert").fadeIn(700).delay(5000).fadeOut(500);
}
/*
* Hide the flash area
* @OVERRIDE
*/
function hide_flash() {
$("#flash-alert").hide();
}
//TODO: Use a js template engine in here
/*
* Render the form errors in a flash message and
* highlight the problematic form controls
*
* Note: This function will highligh those elements with
*/
function form_error(data) {
$('.has-error').removeClass('has-error');
var msg = data.title + "