Sha256: fcd1f81cc53cbb7bc8e6ee88b2ed39904f18574c2d7639e1abc4dc3fb6c8c878
Contents?: true
Size: 1.15 KB
Versions: 26
Compression:
Stored size: 1.15 KB
Contents
if (typeof(Alchemy) === 'undefined') { var Alchemy = {}; } (function($) { var Growler = {}; $.extend(Alchemy, Growler); Alchemy.Growler = { build : function(message, flash_type) { var $flash_container = $('<div class="flash '+flash_type+'" />'); var icon_class = flash_type === 'notice' ? 'tick' : 'error'; $flash_container.append('<span class="icon '+icon_class+'" />'); $flash_container.append(message); $('#flash_notices').append($flash_container); $('#flash_notices').show(); Alchemy.Growler.fade(); }, fade : function() { $('#flash_notices div[class!="flash error"]').delay(5000).hide('drop', { direction: "up" }, 400, function() { $(this).remove(); }); $('#flash_notices div[class="flash error"]') .css({cursor: 'pointer'}) .click(function() { $(this).hide('drop', { direction: "up" }, 400, function() { $(this).remove(); }); }); } }, Alchemy.growl = function(message, style) { if (typeof(style) === 'undefined') { style = 'notice'; } Alchemy.Growler.build(message, style); } })(jQuery);
Version data entries
26 entries across 20 versions & 1 rubygems