mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: Use jquery instead of prototype for silverstripenavigator (from r93966)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@93973 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
de0991c968
commit
b9bbecdbee
@ -290,18 +290,20 @@ class ContentController extends Controller {
|
||||
if(Director::isDev() || Permission::check('CMS_ACCESS_CMSMain')) {
|
||||
Requirements::css(SAPPHIRE_DIR . '/css/SilverStripeNavigator.css');
|
||||
|
||||
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js');
|
||||
// Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/prototype.js');
|
||||
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
|
||||
Requirements::customScript(<<<JS
|
||||
Behaviour.register({
|
||||
'#switchView a' : {
|
||||
onclick : function() {
|
||||
var w = window.open(this.href);
|
||||
(function($) {
|
||||
$('#switchView a').click(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');
|
||||
})(jQuery);
|
||||
JS
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user