New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
alertify global enable disable option #188
Labels
Comments
Easiest method to solve it in your production code, is to prevent the script from loading by adding it dynamically if some conditions are met: <script>
if (development) {
let alertify = document.createElement('script'), attr = {
type: 'text/javascript',
src: 'path/to/alertify.js',
crossorigin: 'anonymous'
};
for (let n in attr) {
if (attr.hasOwnProperty(n)) {
alertify.setAttribute(n, attr[n]);
}
}
document.head.appendChild(alertify);
}
</script> Your request doesn't require any modification of alertify or how to implement it. Another solution would be on every usage where it is not needed in production make use of a simple check: if (development) { alertify.alert(title, text); }
// or a wrapper
function printError() {
if (development) {
alertify.alert.apply(alertify, arguments);
}
}
printError(title, text); Greetings :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i do not know if there is global enable disable alertify flag option currently available or not . so it will be good to have global flag where we could enable disable alertify globally. like in development we use alerts but in product we do not want to show alerts of success errors etc.
The text was updated successfully, but these errors were encountered: