smartphone-spoiler.js: make it work with thread expanding etc.

This commit is contained in:
czaks 2013-07-03 01:18:44 -04:00
parent 37c1b134de
commit 7180a77705

View File

@ -13,12 +13,21 @@
onready(function(){
if(device_type == 'mobile') {
var spoilers = document.getElementsByClassName('spoiler');
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).bind('new_post', function(e, post) {
fix_spoilers(post);
});
}
});