Added support for attribute to ignoring auto spoilers opening (#1466)

* Added support for attribute to ignoring auto spoilers opening

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-05-05 00:50:28 +07:00 committed by GitHub
commit 65a7b89a9e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 3 deletions

View file

@ -380,8 +380,9 @@ function initSpoilers(context) {
$('div.sp-body', context).each(function () {
var $sp_body = $(this);
var name = $.trim(this.title) || '' + bbl['spoiler_head'] + '';
var no_sp_open = ($.trim($sp_body.attr('no-sp-open')) === "true") ? ' ignore-sp-open' : '';
this.title = '';
var $sp_head = $('<div class="sp-head folded clickable">' + name + '</div>');
var $sp_head = $('<div class="sp-head folded clickable' + no_sp_open + '">' + name + '</div>');
$sp_head.insertBefore($sp_body).click(function (e) {
if (!$sp_body.hasClass('inited')) {
initPostImages($sp_body);