changeset 25:06d7972287c1

(none)
author Edho Arief <me@myconan.net>
date Tue, 17 Nov 2015 11:01:09 +0000
parents 8ce6738a3a81
children 6ff29abe127d
files tweetdeck-large-image.user.js
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tweetdeck-large-image.user.js	Tue Nov 17 10:56:29 2015 +0000
+++ b/tweetdeck-large-image.user.js	Tue Nov 17 11:01:09 2015 +0000
@@ -13,9 +13,12 @@
   var $ = jQuery;
   
   $(document).off('.ec-userscript');
-  $(document).on('click.ec-userscript', '.js-media-image-link', function(e) {
-    var $link = $(e.currentTarget);
-    var url = getComputedStyle($link[0]).backgroundImage.replace(/^url\(('|")?(.+?)(:small)?\1\)$/, '$2');
-    $link.attr('href', url + ':orig');
+  $(document).on('mouseenter.ec-userscript', '.js-media-image-link', function(e) {
+    var link = e.currentTarget;
+    if (link._ecUserscript === true) { return; }
+    
+    var url = getComputedStyle(link).backgroundImage.replace(/^url\(('|")?(.+?)(:small)?\1\)$/, '$2');
+    link.setAttribute('href', url + ':orig');
+    link._ecUserscript = true;
   });
 }).call();
\ No newline at end of file