can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r18527: LJSUP-8099: I can open a few bubbles at ...

Committer: dpetrov
LJSUP-8099: I can open a few bubbles at the same time
U   trunk/htdocs/js/share.js
Modified: trunk/htdocs/js/share.js
===================================================================
--- trunk/htdocs/js/share.js	2011-03-14 03:39:04 UTC (rev 18526)
+++ trunk/htdocs/js/share.js	2011-03-14 04:25:14 UTC (rev 18527)
@@ -159,7 +159,7 @@
 	var link = jQuery( 'a:last' ),
 		url = link.attr( 'href' ),
 		options = jQuery.extend( {}, defaults, { url: url } , opts ),
-		dom, arrow;
+		dom, arrow, skipCloseEvent;
 
 	var links = ( opts.links ) ? opts.links : global_options.links;
 
@@ -197,9 +197,16 @@
 			ev.stopPropagation();
 		} );
 
+		function checkClose( e ) {
+			if( !skipCloseEvent ) {
+				togglePopup( false );
+			}
+			skipCloseEvent = false;
+		}
+
 		dom.find( selectors.close ).bind( 'click', function( ev ) {	togglePopup( false ); } );
-		$( document ).bind( 'click', function( ev ) { togglePopup( false ); } );
-		$( window ).bind( 'resize', function( ev ) { togglePopup( false ); } );
+		$( document ).bind( 'click', checkClose );
+		$( window ).bind( 'resize', checkClose );
 		dom.find( selectors.links ).click( function() { togglePopup( false ); } );
 	}
 
@@ -272,8 +279,8 @@
 			}
 
 			togglePopup( true );
+			skipCloseEvent = true;
 			ev.preventDefault();
-			ev.stopPropagation();
 		} );
 }
 

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