From 833af50181aa9c8574899b20a216400e7b9d12d1 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Thu, 23 Jun 2011 22:54:27 +1000 Subject: [PATCH] middle click on images opens them normally --- main.js | 7 +++++-- templates/main.js | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) mode change 100644 => 100755 main.js mode change 100644 => 100755 templates/main.js diff --git a/main.js b/main.js old mode 100644 new mode 100755 index 4f69a205..c0ee283b --- a/main.js +++ b/main.js @@ -136,7 +136,10 @@ function init() link = document.getElementsByTagName('a'); for ( i in link ) { if(typeof link[i] == "object" && link[i].childNodes[0].src) { - link[i].onclick = function() { + link[i].onclick = function(e) { + if(e.which == 2) { + return true; + } if(!this.tag) { this.tag = this.childNodes[0].src; this.childNodes[0].src = this.href; @@ -165,5 +168,5 @@ var RecaptchaOptions = { theme : 'clean' }; - window.onload = init; + diff --git a/templates/main.js b/templates/main.js old mode 100644 new mode 100755 index cf9f9e77..6d0eeabc --- a/templates/main.js +++ b/templates/main.js @@ -136,7 +136,10 @@ function init() link = document.getElementsByTagName('a'); for ( i in link ) { if(typeof link[i] == "object" && link[i].childNodes[0].src) { - link[i].onclick = function() { + link[i].onclick = function(e) { + if(e.which == 2) { + return true; + } if(!this.tag) { this.tag = this.childNodes[0].src; this.childNodes[0].src = this.href;