Sha256: f994985224c7321c0793640ec406ad411c65bf5f62a5d10d0143cb029f53a644
Contents?: true
Size: 1.97 KB
Versions: 52
Compression:
Stored size: 1.97 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, ref3; 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; this.hide = (ref3 = opts.hide) != null ? ref3 : true; } 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'); node.removeClass('notice').removeClass('alert').removeClass('warning'); 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'); if (this.hide) { return this.hideAfterTime(); } }; Flash.prototype.hideAfterTime = 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
52 entries across 26 versions & 1 rubygems