Meta and Middle click not triggering new tab

This commit is contained in:
Ruud
2014-10-11 15:35:56 +02:00
parent 65f0dc25d2
commit c992680209

View File

@@ -54,16 +54,22 @@
},
pushState: function(e){
if((!e.meta && Browser.platform.mac) || (!e.control && !Browser.platform.mac)){
var self = this;
if((!e.meta && self.isMac()) || (!e.control && !self.isMac())){
(e).preventDefault();
var url = e.target.get('href');
if(History.getPath() != url)
// Middle click
if(e.event && e.event.button == 1)
window.open(url);
else if(History.getPath() != url)
History.push(url);
}
},
isMac: function(){
return Browser.platform.mac
return Browser.platform == 'mac'
},
createLayout: function(){
@@ -325,11 +331,12 @@
},
openDerefered: function(e, el){
var self = this;
(e).stop();
var url = 'http://www.dereferer.org/?' + el.get('href');
if(el.get('target') == '_blank' || (e.meta && Browser.platform.mac) || (e.control && !Browser.platform.mac))
if(el.get('target') == '_blank' || (e.meta && self.isMac()) || (e.control && !self.isMac()))
window.open(url);
else
window.location = url;