Allow open in new tab
This commit is contained in:
1 parent
c70489fddb
commit
21105d324e
2 files changed
+8
-7
No files matched your search
@@ -86,7 +86,7 @@ var UserscriptSettingTab = new Class({
|
|||||||
new Element('a', {
|
new Element('a', {
|
||||||
'text': 'Install userscript',
|
'text': 'Install userscript',
|
||||||
'href': Api.createUrl('userscript.get')+'couchpotato.user.js',
|
'href': Api.createUrl('userscript.get')+'couchpotato.user.js',
|
||||||
'normalhref': true
|
'target': '_self'
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ var CouchPotato = new Class({
|
|||||||
self.openPage(window.location.pathname);
|
self.openPage(window.location.pathname);
|
||||||
|
|
||||||
History.addEvent('change', self.openPage.bind(self));
|
History.addEvent('change', self.openPage.bind(self));
|
||||||
self.c.addEvent('click:relay(a[href]:not([target=_blank]):not([normalhref=true]))', self.pushState.bind(self));
|
self.c.addEvent('click:relay(a[href^=/]:not([target]))', self.pushState.bind(self));
|
||||||
},
|
},
|
||||||
|
|
||||||
getOption: function(name){
|
getOption: function(name){
|
||||||
@@ -42,11 +42,12 @@ var CouchPotato = new Class({
|
|||||||
|
|
||||||
pushState: function(e){
|
pushState: function(e){
|
||||||
var self = this;
|
var self = this;
|
||||||
(e).stop();
|
if((!e.meta && Browser.Platform.mac) || (!e.control && !Browser.Platform.mac)){
|
||||||
|
(e).stop();
|
||||||
var url = e.target.get('href');
|
var url = e.target.get('href');
|
||||||
if(History.getPath() != url)
|
if(History.getPath() != url)
|
||||||
History.push(url);
|
History.push(url);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
createLayout: function(){
|
createLayout: function(){
|
||||||
|
|||||||
Reference in new issue
Block a user