{"size": 705, "ext": "js", "max_stars_repo_path": "atom-ternjs/lib/atom-ternjs-documentation-view.js", "max_stars_repo_name": "raintao/Atom_packages", "max_stars_repo_stars_event_min_datetime": "2015-01-09T16:07:53.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-26T20:48:37.000Z", "max_issues_repo_path": "atom-ternjs/lib/atom-ternjs-documentation-view.js", "max_issues_repo_name": "raintao/Atom_packages", "max_issues_repo_issues_event_min_datetime": "2015-01-06T09:45:34.000Z", "max_issues_repo_issues_event_max_datetime": "2020-07-16T04:08:58.000Z", "max_forks_repo_path": "atom-ternjs/lib/atom-ternjs-documentation-view.js", "max_forks_repo_name": "raintao/Atom_packages", "max_forks_repo_forks_event_min_datetime": "2015-01-28T19:48:24.000Z", "max_forks_repo_forks_event_max_datetime": "2020-07-09T20:54:58.000Z"}
{"max_stars_count": 761, "max_issues_count": 352, "max_forks_count": 122, "avg_line_length": 17.1951219512, "max_line_length": 72, "alphanum_fraction": 0.6170212766}
'use babel';

import TernView from './atom-ternjs-view';

class DocumentationView extends TernView {

  createdCallback() {

    this.getModel();
    this.addEventListener('click', () => {

      this.getModel().destroyOverlay();

    }, false);

    this.container = document.createElement('div');

    this.container.onmousewheel = (e) => {

      e.stopPropagation();
    };

    this.appendChild(this.container);
  }

  setData(data) {

    this.container.innerHTML = `

      <h3>${data.type}</h3>
      <p>${data.doc}</p>
      <a href="${data.url}">${data.url}</p>
    `;
  }
}

module.exports = document.registerElement('atom-ternjs-documentation', {

  prototype: DocumentationView.prototype
});
