can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r20667: LJSUP-10571: add an ability to disable c...

Committer: dpetrov
LJSUP-10571: add an ability to disable contextual popup for certain nodes.
U   trunk/htdocs/js/contextualhover.js
Modified: trunk/htdocs/js/contextualhover.js
===================================================================
--- trunk/htdocs/js/contextualhover.js	2011-11-30 15:21:38 UTC (rev 20666)
+++ trunk/htdocs/js/contextualhover.js	2011-12-01 06:15:36 UTC (rev 20667)
@@ -554,6 +554,7 @@
 			// attach to all ljuser head icons
 			var rex_userid = /\?userid=(\d+)/,
 				rex_userpic = /(userpic\..+\/\d+\/\d+)|(\/userpic\/\d+\/\d+)/,
+				class_nopopup = 'noctxpopup',
 				ljusers = jQuery('span.ljuser>a>img', node),
 				i = -1, userid, ljuser, parent;
 
@@ -562,7 +563,7 @@
 				ljuser = ljusers[i];
 				parent = ljuser.parentNode;
 
-				if (parent.href && (userid = parent.href.match(rex_userid))) {
+				if (parent.href && (userid = parent.href.match(rex_userid)) && !(parent.className.indexOf(class_nopopup) >= 0)) {
 					ljuser.userid = userid[1];
 				} else if (parent.parentNode.getAttribute('lj:user')) {
 					ljuser.username = parent.parentNode.getAttribute('lj:user');
@@ -580,7 +581,7 @@
 			i = -1;
 			while (ljusers[++i]) {
 				ljuser = ljusers[i];
-				if (ljuser.src.match(rex_userpic)) {
+				if (ljuser.src.match(rex_userpic) && !(ljuser.className.indexOf(class_nopopup) >= 0)) {
 					ljuser.up_url = ljuser.src;
 					if (ljuser.parentNode.getAttribute('data-journal')) {
 						ljuser.posted_in = ljuser.parentNode.getAttribute('data-journal');

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