modal/index.js
function Modal(config) {
  this.config = config;
  this.timers_ = [];
  this.scrollY = 0;

  this.initDom_();

  var closeAttribute = 'data-' + this.config.className + '-x';
  var closeClass = this.config.className + '-x';
  var data = 'data-' + this.config.className + '-id';
  var func = function(targetEl, e) {
    var modalId = targetEl.getAttribute(data);
    if (modalId) {
      e.preventDefault();
      this.setActive_(true, modalId);
    }
    if (targetEl.classList.contains(closeClass)
        || targetEl.hasAttribute(closeAttribute)) {
      this.setActive_(false);
    }
  }.bind(this);
  events.addDelegatedListener(document, 'click', func);

  this.initStateFromHash_();
}
function Modal(config) {
  this.config = config;
  this.timers_ = [];
  this.scrollY = 0;

  this.initDom_();

  var closeAttribute = 'data-' + this.config.className + '-x';
  var closeClass = this.config.className + '-x';
  var data = 'data-' + this.config.className + '-id';
  var func = function(targetEl, e) {
    var modalId = targetEl.getAttribute(data);
    if (modalId) {
      e.preventDefault();
      this.setActive_(true, modalId);
    }
    if (targetEl.classList.contains(closeClass)
        || targetEl.hasAttribute(closeAttribute)) {
      this.setActive_(false);
    }
  }.bind(this);
  events.addDelegatedListener(document, 'click', func);

  this.initStateFromHash_();
}
function Modal ( config ) { this . config = config ; this . timers_ = [ ] ; this . scrollY = 0 ; this . initDom_ ( ) ; var closeAttribute = 'data-' + this . config . className + '-x' ; var closeClass = this . config . className + '-x' ; var data = 'data-' + this . config . className + '-id' ; var func = function ( targetEl , e ) { var modalId = targetEl . getAttribute ( data ) ; if ( modalId ) { e . preventDefault ( ) ; this . setActive_ ( true , modalId ) ; } if ( targetEl . classList . contains ( closeClass ) || targetEl . hasAttribute ( closeAttribute ) ) { this . setActive_ ( false ) ; } } . bind ( this ) ; events . addDelegatedListener ( document , 'click' , func ) ; this . initStateFromHash_ ( ) ; }
Modal dialog.
@constructor
Modal dialog .