ttrss/plugins/nsfw/init.js

19 lines
417 B
JavaScript
Raw Normal View History

/* global Plugins */
2013-02-23 12:02:29 +00:00
Plugins.NSFW = {
toggle: function(elem) {
2021-03-07 10:22:38 +00:00
elem = elem.domNode || elem;
2021-03-07 10:22:38 +00:00
const content = elem.closest(".nsfw-wrapper").querySelector('.nsfw-content');
// we can't use .toggle() here because this script could be invoked by the api client
// so it's back to vanilla js
if (content.style.display == 'none')
content.style.display = '';
else
content.style.display = 'none';
2013-02-23 12:02:29 +00:00
}
}