Vlad Kurkin (b_vladi) wrote in changelog,
Vlad Kurkin
b_vladi
changelog

[livejournal] r21222: LJSUP-11031: <lj-spoiler> tag

Committer: vkurkin
LJSUP-11031: <lj-spoiler> tag
U   trunk/htdocs/js/livejournal.js
Modified: trunk/htdocs/js/livejournal.js
===================================================================
--- trunk/htdocs/js/livejournal.js	2012-02-20 13:34:00 UTC (rev 21221)
+++ trunk/htdocs/js/livejournal.js	2012-02-20 15:11:59 UTC (rev 21222)
@@ -640,12 +640,9 @@
 }();
 
 jQuery(function($) {
-    $(document.body).click(function(e) {
-        var target = $(e.target);
-        if (!target.is(".lj-spoiler > p.lj-spoiler-open > a")) return;
-
-        e.preventDefault();
-        target.parent().parent().toggleClass("lj-spoiler-opened");
-    });
+	$(document).delegate('.lj-spoiler > p.lj-spoiler-head a', 'click', function (evt) {
+		evt.preventDefault();
+		$(this).closest('.lj-spoiler').toggleClass('lj-spoiler-opened');
+	});
 });
 

Tags: b_vladi, js, livejournal, vkurkin
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments