Skip to content

Instantly share code, notes, and snippets.

@Theadd
Created April 24, 2014 07:34
Show Gist options
  • Save Theadd/c8cb5d21c3e5934094fb to your computer and use it in GitHub Desktop.
Save Theadd/c8cb5d21c3e5934094fb to your computer and use it in GitHub Desktop.
/** Class to manage bootstrap growl floating alerts.
* @constructor
* @type {class}
* @example
* var abox = new alertManager();
* abox.warn('This is a warning.');
*/
function alertManager() {
/** @constructs */
(function() {
//Do something here...
})();
/** Set busy state.
*
* @see queryManager#isBusy
* @param is_busy {boolean} new busy state.
*/
this.warn = function(msg) {
$.growl({
icon: 'fa fa-warning',
message: msg,
title: ''
}, {
ele: "#content",
type: "warning",
allow_dismiss: true,
position: {
from: "top",
align: "right"
},
offset: 20,
spacing: 10,
z_index: 1031,
fade_in: 400,
delay: 7000,
pause_on_mouseover: true
});
};
this.error = function(msg) {
$.growl({
icon: 'fa fa-times-circle-o',
message: msg,
title: ''
}, {
ele: "#content",
type: "danger",
allow_dismiss: true,
position: {
from: "top",
align: "right"
},
offset: 20,
spacing: 10,
z_index: 1031,
fade_in: 400,
delay: 7000,
pause_on_mouseover: true
});
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment