Sha256: a38d17a354fef95023046145c627cf8ecf43fd69da697a34aa315bedd9bbb1ad

Contents?: true

Size: 1.78 KB

Versions: 1

Compression:

Stored size: 1.78 KB

Contents

I"(function() {
  var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
    hasProp = {}.hasOwnProperty;

  App.Views.Shared.Flash = (function(superClass) {
    extend(Flash, superClass);

    function Flash(opts) {
      var ref, ref1, ref2;
      if (opts == null) {
        opts = {};
      }
      Flash.__super__.constructor.call(this, opts);
      this.notice = (ref = opts.notice) != null ? ref : null;
      this.alert = (ref1 = opts.alert) != null ? ref1 : null;
      this.warning = (ref2 = opts.warning) != null ? ref2 : null;
    }

    Flash.prototype.setNotice = function(text) {
      return this.notice = text;
    };

    Flash.prototype.setAlert = function(text) {
      return this.alert = text;
    };

    Flash.prototype.setWarning = function(text) {
      return this.warning = text;
    };

    Flash.prototype.render = function() {
      var node;
      node = $('.flash');
      if (this.notice != null) {
        node.addClass('notice');
        node.find('p').text(this.notice);
      } else if (this.alert != null) {
        node.addClass('alert');
        node.find('p').text(this.alert);
      } else if (this.warning != null) {
        node.addClass('warning');
        node.find('p').text(this.warning);
      }
      node.slideDown('normal');
      return this.hide();
    };

    Flash.prototype.hide = function(time) {
      if (time == null) {
        time = 4000;
      }
      return setTimeout(function() {
        return $('.flash').slideUp('normal');
      }, time);
    };

    return Flash;

  })(App.Views.Base);

}).call(this);
:ET

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
loco-rails-0.0.1 test/dummy/tmp/cache/assets/development/sprockets/v3.0/4X9Eh2P0ZRFzpbPA5zO-mQcNqPbmttbBBgDC4Pw5njk.cache