dotledger/dotledger

View on GitHub
app/assets/javascripts/dot_ledger/regions/modal.js

Summary

Maintainability
A
0 mins
Test Coverage
DotLedger.module('Regions', function () {
  this.Modal = Backbone.Marionette.Region.extend({
    onShow: function (view) {
      view.$el.modal('show');
      this.listenTo(view, 'before:destroy', this.closeModal, this);
    },

    closeModal: function () {
      if (this.currentView) {
        this.stopListening();
        this.currentView.$el.modal('hide');
      }
    }
  });
});