From 2cbbcfe3ab0d362ede835ca2662b2faab940114d Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Thu, 11 Mar 2010 04:37:18 +0000 Subject: [PATCH] MINOR SilverStripeNavigator.js used jquery.live instead of livequery, and doesn't include unnecessary behaviour.js git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100883 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- core/control/ContentController.php | 4 ++-- javascript/SilverStripeNavigator.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/control/ContentController.php b/core/control/ContentController.php index 4f7a86734..115781042 100755 --- a/core/control/ContentController.php +++ b/core/control/ContentController.php @@ -299,9 +299,9 @@ class ContentController extends Controller { if(Director::isDev() || Permission::check('CMS_ACCESS_CMSMain') || Permission::check('VIEW_DRAFT_CONTENT')) { if($this->dataRecord) { Requirements::css(SAPPHIRE_DIR . '/css/SilverStripeNavigator.css'); - Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/behaviour/behaviour.js'); + // TODO Using jQuery for this is absolute overkill, and might cause conflicts + // with other libraries. Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery/jquery.js'); - Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-livequery/jquery.livequery.js'); Requirements::javascript(SAPPHIRE_DIR . '/javascript/SilverStripeNavigator.js'); $return = $nav = SilverStripeNavigator::get_for_record($this->dataRecord); diff --git a/javascript/SilverStripeNavigator.js b/javascript/SilverStripeNavigator.js index a5e303209..f57a78b07 100644 --- a/javascript/SilverStripeNavigator.js +++ b/javascript/SilverStripeNavigator.js @@ -4,7 +4,7 @@ function windowName(suffix) { } (function($) { - $('#switchView a.newWindow').livequery('click', + $('#switchView a.newWindow').live('click', function() { var w = window.open(this.href, windowName(this.target)); w.focus(); @@ -12,21 +12,21 @@ function windowName(suffix) { } ); - $('#SilverStripeNavigatorLink').livequery('click', + $('#SilverStripeNavigatorLink').live('click', function() { $('#SilverStripeNavigatorLinkPopup').toggle(); return false; } ); - $('#SilverStripeNavigatorLinkPopup a.close').livequery('click', + $('#SilverStripeNavigatorLinkPopup a.close').live('click', function() { $('#SilverStripeNavigatorLinkPopup').hide(); return false; } ); - $('#SilverStripeNavigatorLinkPopup input').livequery('focus', + $('#SilverStripeNavigatorLinkPopup input').live('focus', function() { this.select(); }