Skip to content

Commit

Permalink
Merge branch 'hotfix-spoiler' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceFox committed Oct 13, 2014
2 parents eae6561 + 2f9d8b4 commit c02235a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion assets/js/spoiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

function buildSpoilers($elem){
$elem.each(function(){
$(this).addClass("spoiler-build");
$(this).before($("<a/>", {
text: "Afficher/Masquer le contenu masqué",
class: "spoiler-title ico-after view",
Expand All @@ -24,7 +25,9 @@
$(document).ready(function(){
buildSpoilers($("#content .spoiler"));
$("#content").on("DOMNodeInserted", ".spoiler", function(e){
buildSpoilers($(e.target));
if($(e.target).is(".spoiler:not(.spoiler-build)")){
buildSpoilers($(e.target));
}
});
});
})(document, jQuery);

0 comments on commit c02235a

Please sign in to comment.