You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
695 B

  1. // This file will be loaded on public pages, regardless of theme.
  2. const { delegate } = require('rails-ujs');
  3. delegate(document, '.webapp-btn', 'click', ({ target, button }) => {
  4. if (button !== 0) {
  5. return true;
  6. }
  7. window.location.href = target.href;
  8. return false;
  9. });
  10. delegate(document, '.status__content__spoiler-link', 'click', ({ target }) => {
  11. const contentEl = target.parentNode.parentNode.querySelector('.e-content');
  12. if (contentEl.style.display === 'block') {
  13. contentEl.style.display = 'none';
  14. target.parentNode.style.marginBottom = 0;
  15. } else {
  16. contentEl.style.display = 'block';
  17. target.parentNode.style.marginBottom = null;
  18. }
  19. return false;
  20. });