mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Fix navigator links not opening in new windows. (from r97510)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99086 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
a049f6e96d
commit
7f4a515649
@ -312,6 +312,8 @@ class ContentController extends Controller {
|
||||
}
|
||||
$viewPageIn = _t('ContentController.VIEWPAGEIN', 'View Page in:');
|
||||
|
||||
Requirements::customScript("window.name = windowName('site');");
|
||||
|
||||
return <<<HTML
|
||||
<div id="SilverStripeNavigator">
|
||||
<div class="holder">
|
||||
|
@ -1,20 +1,17 @@
|
||||
Behaviour.register({
|
||||
'#switchView a.newWindow' : {
|
||||
onclick : function() {
|
||||
var w = window.open(this.href,windowName(this.target));
|
||||
w.focus();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function windowName(suffix) {
|
||||
var base = document.getElementsByTagName('base')[0].href.replace('http://','').replace(/\//g,'_').replace(/\./g,'_');
|
||||
return base + suffix;
|
||||
}
|
||||
window.name = windowName('site');
|
||||
|
||||
(function($) {
|
||||
$('#switchView a.newWindow').livequery('click',
|
||||
function() {
|
||||
var w = window.open(this.href, windowName(this.target));
|
||||
w.focus();
|
||||
return false;
|
||||
}
|
||||
);
|
||||
|
||||
$('#SilverStripeNavigatorLink').livequery('click',
|
||||
function() {
|
||||
$('#SilverStripeNavigatorLinkPopup').toggle();
|
||||
|
Loading…
Reference in New Issue
Block a user