-
-
Save Theadd/c8cb5d21c3e5934094fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** 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