can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r21423: 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-15 08:13:34 UTC (rev 21422)
+++ trunk/htdocs/js/journal.js	2012-03-15 08:59:55 UTC (rev 21423)
@@ -350,3 +350,25 @@
 	});
 })();
 
+/**
+ * this code initializes common properies for all widgets.
+ * 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.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