diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2016-08-23 20:02:23 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2016-08-23 20:02:50 -0400 |
commit | ad3f35663e4e2b80a92166b590d3e2052b5aab91 (patch) | |
tree | 94f987efbdb50e1426956c1c04ac459a19c77e53 /plugins/jetpack/modules/sharedaddy/sharing-sources.php | |
parent | bin/update-wordpress: also update twentyfourteen twentyfifteen twentysixteen (diff) | |
download | blogs-gentoo-ad3f35663e4e2b80a92166b590d3e2052b5aab91.tar.gz blogs-gentoo-ad3f35663e4e2b80a92166b590d3e2052b5aab91.tar.bz2 blogs-gentoo-ad3f35663e4e2b80a92166b590d3e2052b5aab91.zip |
Update plugin jetpack to 4.2.2
Diffstat (limited to 'plugins/jetpack/modules/sharedaddy/sharing-sources.php')
-rw-r--r-- | plugins/jetpack/modules/sharedaddy/sharing-sources.php | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/plugins/jetpack/modules/sharedaddy/sharing-sources.php b/plugins/jetpack/modules/sharedaddy/sharing-sources.php index 1fc6cef0..4e6f421b 100644 --- a/plugins/jetpack/modules/sharedaddy/sharing-sources.php +++ b/plugins/jetpack/modules/sharedaddy/sharing-sources.php @@ -329,15 +329,13 @@ abstract class Sharing_Source { $opts = implode( ',', $opts ); ?> <script type="text/javascript"> - var windowOpen; - jQuery(document).on( 'ready post-load', function(){ - jQuery( 'a.share-<?php echo $name; ?>' ).on( 'click', function() { - if ( 'undefined' !== typeof windowOpen ){ // If there's another sharing window open, close it. - windowOpen.close(); - } - windowOpen = window.open( jQuery(this).attr( 'href' ), 'wpcom<?php echo $name; ?>', '<?php echo $opts; ?>' ); - return false; - }); + var windowOpen; + jQuery(document.body).on('click', 'a.share-<?php echo $name; ?>', function() { + if ( 'undefined' !== typeof windowOpen ){ // If there's another sharing window open, close it. + windowOpen.close(); + } + windowOpen = window.open( jQuery(this).attr( 'href' ), 'wpcom<?php echo $name; ?>', '<?php echo $opts; ?>' ); + return false; }); </script> <?php @@ -1518,7 +1516,7 @@ class Share_Pinterest extends Sharing_Source { </script> <?php elseif ( 'buttonPin' != $this->get_widget_type() ) : ?> <script type="text/javascript"> - jQuery(document).on('ready', function(){ + jQuery(document).ready( function(){ jQuery('body').on('click', 'a.share-pinterest', function(e){ e.preventDefault(); // Load Pinterest Bookmarklet code @@ -1590,7 +1588,7 @@ class Share_Pocket extends Sharing_Source { function jetpack_sharing_pocket_init() { jQuery.getScript( 'https://widgets.getpocket.com/v1/j/btn.js?v=1' ); } - jQuery( document ).on( 'ready', jetpack_sharing_pocket_init ); + jQuery( document ).ready( jetpack_sharing_pocket_init ); jQuery( document.body ).on( 'post-load', jetpack_sharing_pocket_init ); </script> <?php @@ -1641,7 +1639,7 @@ class Jetpack_Share_WhatsApp extends Sharing_Source { } public function get_display( $post ) { - return $this->get_link( 'whatsapp://send?text=' . rawurlencode( $this->get_share_title( $post->ID ) ) . ' ' . rawurlencode( get_permalink( $post->ID ) ), _x( 'WhatsApp', 'share to', 'jetpack' ), __( 'Click to share on WhatsApp', 'jetpack' ) ); + return $this->get_link( 'whatsapp://send?text=' . rawurlencode( $this->get_share_title( $post->ID ) ) . ' ' . rawurlencode( $this->get_share_url( $post->ID ) ), _x( 'WhatsApp', 'share to', 'jetpack' ), __( 'Click to share on WhatsApp', 'jetpack' ) ); } } |