mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-23 18:50:12 +01:00
No more CookieManager since it's dependent on Prototype
This commit is contained in:
parent
e57e1445b4
commit
fac5e7ca83
6 changed files with 106 additions and 131 deletions
|
|
@ -15,7 +15,6 @@ ToDoItems.prototype = {
|
|||
/* keep track of last effect so you can check if the animation has finised */
|
||||
this.lastEffect= null;
|
||||
this.initialized = true;
|
||||
this.contextCollapseCookieManager = new CookieManager();
|
||||
this.toggleItemsMap = {};
|
||||
this.toggleContainerMap = {};
|
||||
this.containerItemsMap = {};
|
||||
|
|
@ -41,7 +40,7 @@ ToDoItems.prototype = {
|
|||
{
|
||||
toggleElem = this.containerToggles[i];
|
||||
containerElem = this.toggleContainerMap[toggleElem.id];
|
||||
collapsedCookie = this.contextCollapseCookieManager.getCookie(this.buildCookieName(containerElem));
|
||||
collapsedCookie = $.cookie(this.buildCookieName(containerElem));
|
||||
itemsElem = this.toggleItemsMap[toggleElem.id];
|
||||
isExpanded = Element.visible(itemsElem);
|
||||
if (collapsedCookie && isExpanded)
|
||||
|
|
@ -93,12 +92,12 @@ ToDoItems.prototype = {
|
|||
if (Element.visible(itemsElem))
|
||||
{
|
||||
this.collapseNextActionListing(toggleElem, itemsElem);
|
||||
this.contextCollapseCookieManager.setCookie(this.buildCookieName(containerElem), true)
|
||||
$.cookie(this.buildCookieName(containerElem), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.expandNextActionListing(toggleElem, itemsElem);
|
||||
this.contextCollapseCookieManager.clearCookie(this.buildCookieName(containerElem))
|
||||
$.cookie(this.buildCookieName(containerElem), null);
|
||||
}
|
||||
},
|
||||
findToggleElemForContext : function(contextElem)
|
||||
|
|
@ -148,7 +147,7 @@ ToDoItems.prototype = {
|
|||
},
|
||||
buildCookieName: function(containerElem)
|
||||
{
|
||||
tracks_login = this.contextCollapseCookieManager.getCookie('tracks_login');
|
||||
tracks_login = $.cookie('tracks_login');
|
||||
return 'tracks_'+tracks_login+'_context_' + containerElem.id + '_collapsed';
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue