mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Add missing JS file (from r97410)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99084 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
daba461c48
commit
61c126f93b
31
javascript/SilverStripeNavigator.js
Normal file
31
javascript/SilverStripeNavigator.js
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
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($) {
|
||||||
|
$('#SilverStripeNavigatorLink').livequery('click',
|
||||||
|
function() {
|
||||||
|
$('#SilverStripeNavigatorLinkPopup').toggle();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
$('#SilverStripeNavigatorLinkPopup input').livequery('focus',
|
||||||
|
function() {
|
||||||
|
this.select();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
})(jQuery);
|
Loading…
x
Reference in New Issue
Block a user