Sha256: 3b0771fd37a7ae7730d23e5b181d4b1e1a923556d7b9c621050a15bef76209aa

Contents?: true

Size: 865 Bytes

Versions: 11

Compression:

Stored size: 865 Bytes

Contents

Informant.NoticeView = Backbone.View.extend({
    className: "success",
    displayLength: 5000,
    defaultMessage: '',
    
    initialize: function() {
        _.bindAll(this, 'render');
        this.message = this.options.message || this.defaultMessage;
        this.render();
    },
    
    render: function() {
        var view = this;
        
        $(this.el).html(this.message);
        $(this.el).hide();
        $('#notices').html(this.el);
        $(this.el).slideDown();
        $.doTimeout(this.displayLength, function() {
            $(view.el).slideUp();
            $.doTimeout(2000, function() {
                view.remove();
            });
        });
        
        return this;
    }
});

Informant.ErrorView = Informant.NoticeView.extend({
    className: "error",
    defaultMessage: 'Uh oh! Something went wrong. Please try again.'
});

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
c2-0.1.13 public/javascripts/c2/informant/views/notice.js
c2-0.1.12 public/javascripts/c2/informant/views/notice.js
c2-0.1.11 public/javascripts/c2/informant/views/notice.js
c2-0.1.10 public/javascripts/c2/informant/views/notice.js
c2-0.1.9 public/javascripts/c2/informant/views/notice.js
c2-0.1.8 public/javascripts/c2/informant/views/notice.js
c2-0.1.7 public/javascripts/c2/informant/views/notice.js
c2-0.1.6 public/javascripts/c2/informant/views/notice.js
c2-0.1.5 public/javascripts/c2/informant/views/notice.js
c2-0.1.4 public/javascripts/c2/informant/views/notice.js
c2-0.1.3 public/javascripts/c2/informant/views/notice.js