Opened 13 years ago
Closed 12 years ago
#4938 closed bug (worksforme)
Issue with Tabs/Cookie
Reported by: | Eagle | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.9.0 |
Component: | ui.tabs | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The Tabs component supports remembering which tab was last made active through the use of cookies and the jQuery Cookie plugin. However, it appears that the Tabs code does not actually invokve the Cookie plugin in the correct fashion.
The cookie plugin for reading and writing cookies works off the basis that:
- If a name and value are passed, it creates a cookie with those
values (and any other parameters).
- If only a name is passed, the corresponding cookie is read if
possible.
- If a name and null are passed, it expires the named cookie.
The trick is that the cookie plugin uses typeof to determine whether a value was supplied, even if it is a null:
jQuery.cookie = function(name, value, options) {
if (typeof value != 'undefined') { name and value given, set
cookie
The call from jQuery UI to the plugin, however, provides null for the value parameter even when attempting to read back the value, meaning value is not undefined but rather null, and thus invoking the expiry mechanism.
Change History (2)
comment:1 Changed 13 years ago by
Milestone: | TBD → 1.8 |
---|
comment:2 Changed 12 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Works fine for me, testing in master and 1.7.2.