Closed mccormjt closed 8 years ago
This would be pretty easy to implement as the code is really already there. You just need to expose an interface like this (this code worked for me - btw great gem, super helpful!)
Flash = new function() { var self = this;
self.warning = function(msg) { flashMessage(msg, 'alert'); } self.error = function(msg) { flashMessage(msg, 'error'); }; self.notice = function(msg) { flashMessage(msg, 'info'); } self.success = function(msg) { flashMessage(msg, 'success'); } function flashMessage(msg, type) { $.growlyflash(new Growlyflash.FlashStruct(msg, type)) }
}
@mccormjt Done. I kept the gem's namespace by default to avoid conflicts, so shorthand methods will be available as Growlyflash.warning(msg).
Growlyflash.warning(msg)
This would be pretty easy to implement as the code is really already there. You just need to expose an interface like this (this code worked for me - btw great gem, super helpful!)
Flash = new function() { var self = this;
}