smartphone-spoiler.js: make it work with thread expanding etc.
This commit is contained in:
parent
37c1b134de
commit
7180a77705
@ -13,12 +13,21 @@
|
|||||||
|
|
||||||
onready(function(){
|
onready(function(){
|
||||||
if(device_type == 'mobile') {
|
if(device_type == 'mobile') {
|
||||||
var spoilers = document.getElementsByClassName('spoiler');
|
var fix_spoilers = function(where) {
|
||||||
for(var i = 0; i < spoilers.length; i++) {
|
var spoilers = where.getElementsByClassName('spoiler');
|
||||||
spoilers[i].onmousedown = function() {
|
for(var i = 0; i < spoilers.length; i++) {
|
||||||
this.style.color = 'white';
|
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);
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user