mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-29 01:53:12 +00:00
c1c514ca70
Manually-resolved conflicts: .circleci/config.yml app/controllers/accounts_controller.rb app/controllers/auth/passwords_controller.rb app/controllers/statuses_controller.rb app/javascript/packs/public.js app/models/media_attachment.rb app/views/stream_entries/_content_spoiler.html.haml app/views/stream_entries/_media.html.haml config/locales/en.yml config/locales/ja.yml config/locales/pl.yml lib/mastodon/version.rb Some content from app/javascript/packs/public.js has been split to app/javascript/core/settings.js. Translation strings for glitch-soc's keyword mutes were dropped. Everything else was mostly “take both”.
27 lines
734 B
JavaScript
27 lines
734 B
JavaScript
// This file will be loaded on public pages, regardless of theme.
|
|
|
|
const { delegate } = require('rails-ujs');
|
|
const { length } = require('stringz');
|
|
|
|
delegate(document, '.webapp-btn', 'click', ({ target, button }) => {
|
|
if (button !== 0) {
|
|
return true;
|
|
}
|
|
window.location.href = target.href;
|
|
return false;
|
|
});
|
|
|
|
delegate(document, '.status__content__spoiler-link', 'click', ({ target }) => {
|
|
const contentEl = target.parentNode.parentNode.querySelector('.e-content');
|
|
|
|
if (contentEl.style.display === 'block') {
|
|
contentEl.style.display = 'none';
|
|
target.parentNode.style.marginBottom = 0;
|
|
} else {
|
|
contentEl.style.display = 'block';
|
|
target.parentNode.style.marginBottom = null;
|
|
}
|
|
|
|
return false;
|
|
});
|