View/AlertView

View/AlertView

# new View/AlertView()

Base class for alerts.

Extend this class to provide custom alert behavior:

const AlertView = require('view/alert-view');
const TemplateManager = require('view/template');
let PortalAlertView = AlertView.extend({
   initialize: function(options) {
      AlertView.prototype.initialize.call(this, options);

      // You may override and/or pre-compile alert template
      this.tpl = 'my-alert';
      TemplateManager.compile('my-alert', 'handlebars code...');
   },

   render: function(options) {
       // Provide your custom rendering logic.
       // For example, switch between different templates
       this.tpl = 'alert2';
       AlertView.prototype.render.call(this, options);
   },

   close: function() {
       // Provide your custom dismiss logic: animation, fade effects, etc.
   }
});

Extends