Sha256: 2cb6d75523e56c7f2aebb5c5cbd8dcfe437debc66edbca1b30f10d444d5fc338

Contents?: true

Size: 1.15 KB

Versions: 8

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' : flash_type;
      $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.notice, .flash.warn, .flash.alert', '#flash_notices').delay(5000).hide('drop', {
        direction: "up"
      }, 400, function() {
        $(this).remove();
      });
      $('.flash.error', '#flash_notices').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

8 entries across 8 versions & 1 rubygems

Version Path
alchemy_cms-2.5.3.1 app/assets/javascripts/alchemy/alchemy.growler.js
alchemy_cms-2.5.3 app/assets/javascripts/alchemy/alchemy.growler.js
alchemy_cms-2.5.2.2 app/assets/javascripts/alchemy/alchemy.growler.js
alchemy_cms-2.5.2.1 app/assets/javascripts/alchemy/alchemy.growler.js
alchemy_cms-2.5.2 app/assets/javascripts/alchemy/alchemy.growler.js
alchemy_cms-2.5.1 app/assets/javascripts/alchemy/alchemy.growler.js
alchemy_cms-2.5.0 app/assets/javascripts/alchemy/alchemy.growler.js
alchemy_cms-2.5.0.rc3 app/assets/javascripts/alchemy/alchemy.growler.js