Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options for cookie persistance #31

Closed
guettli opened this issue Nov 21, 2011 · 1 comment
Closed

Options for cookie persistance #31

guettli opened this issue Nov 21, 2011 · 1 comment

Comments

@guettli
Copy link

guettli commented Nov 21, 2011

Hi,

here is a small patch to add options the the cookie persistance:

modwork_esg_d@workdevel114:~$ diff -u media/jquery-treetable/javascripts/jquery.treeTable.js-orig media/jquery-treetable/javascripts/jquery.treeTable.js
--- media/jquery-treetable/javascripts/jquery.treeTable.js-orig 2011-11-21 15:14:04.916003117 +0100
+++ media/jquery-treetable/javascripts/jquery.treeTable.js  2011-11-21 14:50:38.013003191 +0100
@@ -53,7 +53,8 @@
     onNodeHide: null,
     treeColumn: 0,
     persist: false,
-    persistCookiePrefix: 'treeTable_'
+    persistCookiePrefix: 'treeTable_',
+    persistCookieOptions: {}
   };

   // Recursively hide all node's children in a tree
@@ -150,7 +151,7 @@
     if (options.persist) {
       // Store cookie if this node is expanded, otherwise delete cookie.
       var cookieName = options.persistCookiePrefix + $(this).attr('id');
-      $.cookie(cookieName, $(this).hasClass('expanded') ? 'true' : null);
+      $.cookie(cookieName, $(this).hasClass('expanded') ? 'true' : null, options.persistCookieOptions);
     }

     return this;

@ludo
Copy link
Owner

ludo commented Nov 21, 2011

Thanks. Applied in master.

@ludo ludo closed this as completed Nov 21, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants