Browse Source

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

pull/40/head
czaks 11 years ago
parent
commit
7180a77705
  1. 21
      js/smartphone-spoiler.js

21
js/smartphone-spoiler.js

@ -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…
Cancel
Save