From 653625914d8046f86b65e25ab090bccc5e6eae45 Mon Sep 17 00:00:00 2001 From: Normann Lou Date: Wed, 11 Apr 2012 15:01:31 +1200 Subject: [PATCH] ENHANCEMENT SSF-124 make tab select pages list view if the current url is 'listchildren' otherwise use the default action defined in TabSet.js --- javascript/CMSMain.js | 15 +++++++++++++++ templates/Includes/CMSPagesController_Content.ss | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/javascript/CMSMain.js b/javascript/CMSMain.js index 8fee40fd..542753d5 100644 --- a/javascript/CMSMain.js +++ b/javascript/CMSMain.js @@ -3,6 +3,21 @@ */ (function($) { $.entwine('ss', function($){ + + $('#pages-controller-cms-content').entwine({ + /** + * we need to check if the current url contains a sub url 'listchildren' and + * assign a cookie accordingly so the default selected tab is defined on initail + */ + redrawTabs: function() { + if(window.location.href.match(/listchildren/)){ + this.rewriteHashlinks(); + this.tabs({ selected: 1 }); + }else{ + this._super(); + } + } + }); /** * Class: #Form_SearchForm diff --git a/templates/Includes/CMSPagesController_Content.ss b/templates/Includes/CMSPagesController_Content.ss index e5ada14e..ccae9289 100644 --- a/templates/Includes/CMSPagesController_Content.ss +++ b/templates/Includes/CMSPagesController_Content.ss @@ -1,4 +1,4 @@ -
+