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:
Ingo Schommer 2010-02-16 02:38:46 +00:00 committed by Sam Minnee
parent a049f6e96d
commit 7f4a515649
2 changed files with 10 additions and 11 deletions

View File

@ -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">

View File

@ -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();