1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-02-20 20:51:50 +01:00

smartphone-spoiler.js: format

This commit is contained in:
Zankaria 2024-08-05 18:36:34 +02:00
parent 6daae3ec92
commit fa341b29d0

View File

@ -4,7 +4,7 @@
*
* Released under the MIT license
* Copyright (c) 2012 Michael Save <savetheinternet@tinyboard.org>
* Copyright (c) 2013-2014 Marcin Łabanowski <marcin@6irc.net>
* Copyright (c) 2013-2014 Marcin Łabanowski <marcin@6irc.net>
*
* Usage:
* $config['additional_javascript'][] = 'js/mobile-style.js';
@ -12,11 +12,11 @@
*
*/
onready(function(){
if(device_type == 'mobile') {
var fix_spoilers = function(where) {
var spoilers = where.getElementsByClassName('spoiler');
for(var i = 0; i < spoilers.length; i++) {
onready(function() {
if (device_type == 'mobile') {
let fix_spoilers = function(where) {
let spoilers = where.getElementsByClassName('spoiler');
for (let i = 0; i < spoilers.length; i++) {
spoilers[i].onmousedown = function() {
this.style.color = 'white';
};
@ -24,11 +24,10 @@ onready(function(){
};
fix_spoilers(document);
// allow to work with auto-reload.js, etc.
$(document).on('new_post', function(e, post) {
fix_spoilers(post);
});
// allow to work with auto-reload.js, etc.
$(document).on('new_post', function(e, post) {
fix_spoilers(post);
});
}
});