can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r21717: 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-04-13 12:21:41 UTC (rev 21716)
+++ trunk/htdocs/js/journal.js	2012-04-13 13:16:15 UTC (rev 21717)
@@ -362,7 +362,8 @@
 				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,
-							id = this.id.replace('LJWidget_', '') + '-',
+							//widget will have class like appwidget-videoforhomepage where videoforhomepage is the widget id
+							id = this.className.replace(/(?:.*?)appwidget-(\S+).*/, '$1-'),
 							fullid = id + this.getAttribute('data-cid'),
 							cookie = decodeURIComponent(Cookie('clpsd') || ''),
 							cookie_ids = cookie ? cookie.split(':') : [];

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