mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
MINOR: Use jquery instead of prototype for silverstripenavigator
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@93966 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
433af2515c
commit
4bbf2bc040
@ -289,24 +289,21 @@ class ContentController extends Controller {
|
|||||||
if(Director::isDev() || Permission::check('CMS_ACCESS_CMSMain')) {
|
if(Director::isDev() || Permission::check('CMS_ACCESS_CMSMain')) {
|
||||||
Requirements::css(SAPPHIRE_DIR . '/css/SilverStripeNavigator.css');
|
Requirements::css(SAPPHIRE_DIR . '/css/SilverStripeNavigator.css');
|
||||||
|
|
||||||
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/prototype/behaviour.js');
|
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js');
|
||||||
// Requirements::javascript(THIRDPARTY_DIR . '/prototype/prototype.js');
|
|
||||||
Requirements::customScript(<<<JS
|
Requirements::customScript(<<<JS
|
||||||
Behaviour.register({
|
(function($) {
|
||||||
'#switchView a' : {
|
$('#switchView a').click(function() {
|
||||||
onclick : function() {
|
var w = window.open(this.href,windowName(this.target));
|
||||||
var w = window.open(this.href,windowName(this.target));
|
w.focus();
|
||||||
w.focus();
|
return false;
|
||||||
return false;
|
});
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
function windowName(suffix) {
|
function windowName(suffix) {
|
||||||
var base = document.getElementsByTagName('base')[0].href.replace('http://','').replace(/\//g,'_').replace(/\./g,'_');
|
var base = document.getElementsByTagName('base')[0].href.replace('http://','').replace(/\//g,'_').replace(/\./g,'_');
|
||||||
return base + suffix;
|
return base + suffix;
|
||||||
}
|
}
|
||||||
window.name = windowName('site');
|
window.name = windowName('site');
|
||||||
|
})(jQuery);
|
||||||
JS
|
JS
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user