can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r21560: LJSUP-11456: Add link Collapse to Video ...

Committer: dpetrov
LJSUP-11456: Add link Collapse to Video block on cyr home page
U   trunk/htdocs/js/journal.js
Modified: trunk/htdocs/js/journal.js
===================================================================
--- trunk/htdocs/js/journal.js	2012-03-27 13:45:36 UTC (rev 21559)
+++ trunk/htdocs/js/journal.js	2012-03-27 13:52:48 UTC (rev 21560)
@@ -355,20 +355,21 @@
  * If it will become too large, it should be moved to the separate file
  */
 (function() {
-    widgets = [
-        {
-            type: 'collapsable',
-            handler: function() {
-                jQuery(document).on('click', '.appwidget-prop-collapsable', function(ev) {
-                    if (ev.target.className.indexOf('w-head-status-switch') !== -1) {
-                        jQuery(this).toggleClass('appwidget-prop-collapsed',
-                                    ev.target.className.indexOf('collapse') !== -1)
-                    }
-                });
-            }
-        }
-    ];
+	widgets = [
+		{
+			type: 'collapsable',
+			handler: function() {
+				jQuery(document).on('click', '.appwidget-prop-collapsable', function(ev) {
+					if (ev.target.className.indexOf('w-head-status-switch') !== -1) {
+						var videoCollapes = ev.target.className.indexOf('collapse') !== -1
+						jQuery(this).toggleClass('appwidget-prop-collapsed', videoCollapes);
+						Cookie('video_collapsed', videoCollapes ? 1 : null, { domain: location.host, expires: 14 });
+					}
+				});
+			}
+		}
+	];
 
-    widgets.forEach(function(prop) { prop.handler(); });
+	widgets.forEach(function(prop) { prop.handler(); });
 })();
 

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