Sha256: 7985c6a59915e8d0ffe92a949be0cf627afc85f8338698fc02628d80c71a1387

Contents?: true

Size: 650 Bytes

Versions: 4

Compression:

Stored size: 650 Bytes

Contents

import ReactDOM         from 'react-dom';

import loadTranslations from './support/load_translations';
import Comments         from './comments/comments.component';

// Expose global components
window.DecidimComments.renderCommentsComponent = (nodeId, props) => {
  var node = $(`#${nodeId}`)[0];

  ReactDOM.render(
    React.createElement(Comments,props),
    node
  );

  function unmountComponent() {
    ReactDOM.unmountComponentAtNode(node);
    $(document).off('turbolinks:before-render', unmountComponent);
  }

  $(document).on('turbolinks:before-render', unmountComponent);
};

// Load component locales from yaml files
loadTranslations();

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
decidim-comments-0.0.2 app/frontend/entry.js
decidim-0.0.2 decidim-comments/app/frontend/entry.js
decidim-comments-0.0.1 app/frontend/entry.js
decidim-0.0.1 decidim-comments/app/frontend/entry.js