can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r21404: LJSUP-11498: Can't open spoiler

Committer: dpetrov
LJSUP-11498: Can't open spoiler
U   trunk/htdocs/js/livejournal.js
Modified: trunk/htdocs/js/livejournal.js
===================================================================
--- trunk/htdocs/js/livejournal.js	2012-03-13 21:03:45 UTC (rev 21403)
+++ trunk/htdocs/js/livejournal.js	2012-03-14 07:03:59 UTC (rev 21404)
@@ -37,8 +37,9 @@
 	LiveJournal.initInboxUpdate();
 
 	LiveJournal.initNotificationStream();
+	LiveJournal.initSpoilers();
 
-	//ljunq cookie is checked in PageStats/Omniture.pm now
+	//ljuniq cookie is checked in PageStats/Omniture.pm now
 
 	// run other hooks
 	LiveJournal.run_hook("page_load");
@@ -47,6 +48,16 @@
 jQuery(LiveJournal.initPage);
 
 /**
+ * Spoilers functionality - expand hidden text in posts when user clicks on corresponding link
+ */
+LiveJournal.initSpoilers = function() {
+	jQuery(document).delegate('.lj-spoiler > .lj-spoiler-head a', 'click', function (evt) {
+		evt.preventDefault();
+		jQuery(this).closest('.lj-spoiler').toggleClass('lj-spoiler-opened');
+	});
+};
+
+/**
  * Init long-polling connection to the server.
  * Now function can be used for testing purposes and
  * should be modified for any real use. E.g. it could be
@@ -588,10 +599,4 @@
 	return function() { return forceMobile || isMobile; }
 }();
 
-jQuery(function($) {
-	$(document).delegate('.lj-spoiler > p.lj-spoiler-head a', 'click', function (evt) {
-		evt.preventDefault();
-		$(this).closest('.lj-spoiler').toggleClass('lj-spoiler-opened');
-	});
-});
 

Tags: can3p, dpetrov, js, livejournal
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