You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			37 lines
		
	
	
		
			919 B
		
	
	
	
		
			JavaScript
		
	
			
		
		
	
	
			37 lines
		
	
	
		
			919 B
		
	
	
	
		
			JavaScript
		
	
/*
 | 
						|
 * vim: ts=4:sw=4:expandtab
 | 
						|
 */
 | 
						|
(function () {
 | 
						|
    'use strict';
 | 
						|
    window.Whisper = window.Whisper || {};
 | 
						|
 | 
						|
    Whisper.BannerView = Whisper.View.extend({
 | 
						|
        className: 'banner',
 | 
						|
        templateName: 'banner',
 | 
						|
        events: {
 | 
						|
            'click .dismiss': 'onDismiss',
 | 
						|
            'click .body': 'onClick',
 | 
						|
        },
 | 
						|
        initialize: function(options) {
 | 
						|
            this.message = options.message;
 | 
						|
            this.callbacks = {
 | 
						|
                onDismiss: options.onDismiss,
 | 
						|
                onClick: options.onClick
 | 
						|
            };
 | 
						|
            this.render();
 | 
						|
        },
 | 
						|
        render_attributes: function() {
 | 
						|
            return {
 | 
						|
                message: this.message
 | 
						|
            };
 | 
						|
        },
 | 
						|
        onDismiss: function(e) {
 | 
						|
            this.callbacks.onDismiss();
 | 
						|
            e.stopPropagation();
 | 
						|
        },
 | 
						|
        onClick: function() {
 | 
						|
            this.callbacks.onClick();
 | 
						|
        }
 | 
						|
    });
 | 
						|
})();
 |