Permalink
Browse files

ENHANCEMENT Storing last selected tab in a cookie for TabSet.js. Requ…

…ires jquery.cookie plugin.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@92508 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent a32d473 commit 2a53488bb886400dd5f4e7c6c331f24fe902ec33 @chillu chillu committed Nov 21, 2009
Showing with 4 additions and 1 deletion.
  1. +1 −0 forms/TabSet.php
  2. +3 −1 javascript/TabSet.js
View
@@ -54,6 +54,7 @@ public function FieldHolder() {
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/jquery-ui.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/ui.core.js');
Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-ui/ui.tabs.js');
+ Requirements::javascript(SAPPHIRE_DIR . '/thirdparty/jquery-cookie/jquery.cookie.js');
Requirements::css(SAPPHIRE_DIR . '/thirdparty/jquery-ui-themes/smoothness/ui.all.css');
Requirements::css(SAPPHIRE_DIR . '/thirdparty/jquery-ui-themes/smoothness/ui.tabs.css');
View
@@ -11,7 +11,9 @@
this.rewriteHashlinks();
// Initialize jQuery UI tabs
- this.tabs();
+ this.tabs({
+ cookie: $.cookie ? { expires: 30, path: '/' } : false
+ });
},
/**

0 comments on commit 2a53488

Please sign in to comment.