Source code of Leftypol imageboard
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.
 
 
 
 
 

34 lines
943 B

/*
* smartphone-spoiler.js
* https://github.com/savetheinternet/Tinyboard/blob/master/js/smartphone-spoiler.js
*
* Released under the MIT license
* Copyright (c) 2012 Michael Save <[email protected]>
* Copyright (c) 2013-2014 Marcin Łabanowski <[email protected]>
*
* Usage:
* $config['additional_javascript'][] = 'js/mobile-style.js';
* $config['additional_javascript'][] = 'js/smartphone-spoiler.js';
*
*/
$(document).ready(function(){
if(device_type == 'mobile') {
var fix_spoilers = function(where) {
var spoilers = where.getElementsByClassName('spoiler');
for(var i = 0; i < spoilers.length; i++) {
spoilers[i].onmousedown = function() {
this.style.color = 'white';
};
}
};
fix_spoilers(document);
// allow to work with auto-reload.js, etc.
$(document).on('new_post', function(e, post) {
fix_spoilers(post);
});
}
});